Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible character encodings: UTF-8 and ASCII-8BIT when trying to match systemd units status #180

Closed
scalp42 opened this issue Mar 26, 2018 · 1 comment · Fixed by inspec/inspec#3376

Comments

@scalp42
Copy link

scalp42 commented Mar 26, 2018

Hi folks,

I noticed #146 was open but I'm not sure if it's related in some way.

Assuming a default CentOS 7 box for example with dnsmasq installed:

$> yum -y install dnsmasq

And the following test:

describe command('service dnsmasq status') do
  its('stdout') { should match(/\/usr\/sbin\/dnsmasq -k/) }
end

Kitchen will fail with error:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #verify action: [incompatible character encodings: UTF-8 and ASCII-8BIT] on default-centos-7
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Here's a gist to the full log: https://gist.github.com/scalp42/3d788f09510a3c8eb6681f9de20e1f6c

ChefDK versions:

Chef Development Kit Version: 2.5.3
chef-client version: 13.8.5
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)
berks version: 6.3.1
kitchen version: 1.20.0
inspec version: 1.51.21

I'm assuming the error comes from the dot in the status output:

[root@default-centos-7 ~]# service dnsmasq status
Redirecting to /bin/systemctl status dnsmasq.service
● dnsmasq.service - DNS caching server.
   Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-03-26 19:05:51 UTC; 25min ago
 Main PID: 940 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           └─940 /usr/sbin/dnsmasq -k

Mar 26 19:30:24 default-centos-7.vagrantup.com dnsmasq[940]: query[A] google.com from 127.0.0.1
Mar 26 19:30:24 default-centos-7.vagrantup.com dnsmasq[940]: cached google.com is 216.58.192.14

Thanks for looking!

@scalp42
Copy link
Author

scalp42 commented Sep 11, 2018

Thanks a lot @chris-rock ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant