Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
UndefinedConversionError: "\xEF" from ASCII-8BIT to UTF-8 #276
4.0.0, 4.2.0, 5.0.0
Windows Server 2008 R2 Standard, 64 bit.
We are running the chef-client and audit cookbooks on 100+ of our Windows Server 2008 R2 systems and the chef-client run is failing during the audit report. The audits execute successfully, but won't report into Chef Automate (due to the Chef run blowing up).
Steps to Reproduce:
This only happens sometimes. It's happening all over production, but not in our lab environments (possibly a difference in system templates or possibly Active Directory configurations). We are only experiencing this issue with Windows Server 2008 R2 64-bit, in conjunction with the audit cookbook. Removing the audit cookbook from the run list will yield a successful Chef-client run. The audit cookbook is configured to grab compliance profiles from Chef Automate through the Chef Server.
You should get an error similar to
Note: I found this code in the Windows cookbook that may assist in troubleshooting this issue. It seems to address the
@seththoenen, it was all you friend! Let us know what you find. I'm betting your initial hunch was right:
One of the resources in your profile is probably returning a BOM.
@seththoenen thanks for the good sleuthing! We do state in the InSpec readme that PowerShell 3.0 or later is required. We could totally make this a better user experience by doing more proactive checking of the PowerShell version in resources that require it. If you'd like to open an issue on the chef/inspec repo for that feature request, we'd be happy to have that.
I'm going to close this issue since it does not appear to be related to the audit cookbook itself. Thanks again for the great detective work!