{"action":"created","issue":{"url":"https://api.github.com/repos/chef/ohai/issues/523","labels_url":"https://api.github.com/repos/chef/ohai/issues/523/labels{/name}","comments_url":"https://api.github.com/repos/chef/ohai/issues/523/comments","events_url":"https://api.github.com/repos/chef/ohai/issues/523/events","html_url":"https://github.com/chef/ohai/issues/523","id":68284909,"number":523,"title":"cannot encode to UTF-8 (FFI_Yajl::EncodeError)","user":{"login":"theWeird","id":165980,"avatar_url":"https://avatars.githubusercontent.com/u/165980?v=3","gravatar_id":"","url":"https://api.github.com/users/theWeird","html_url":"https://github.com/theWeird","followers_url":"https://api.github.com/users/theWeird/followers","following_url":"https://api.github.com/users/theWeird/following{/other_user}","gists_url":"https://api.github.com/users/theWeird/gists{/gist_id}","starred_url":"https://api.github.com/users/theWeird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theWeird/subscriptions","organizations_url":"https://api.github.com/users/theWeird/orgs","repos_url":"https://api.github.com/users/theWeird/repos","events_url":"https://api.github.com/users/theWeird/events{/privacy}","received_events_url":"https://api.github.com/users/theWeird/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-14T07:04:21Z","updated_at":"2015-04-29T19:11:05Z","closed_at":null,"body":"I have the problem, that chef-client never writes back to the chef server. Instead it quits with a similar UTF-8 error message.\r\n\r\nSo I wanted to scan the output of ohai for invalid characters.\r\n\r\nInstead I got another UTF-8 error message from ohai.\r\n\r\nThe chef-client machine is a debian wheezy system running as openVZ guest.\r\n\r\n```\r\n # ohai\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:50:in `raise_error_for_status': Invalid UTF-8 string: cannot encode to UTF-8 (FFI_Yajl::EncodeError)\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `do_yajl_encode'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `encode'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:181:in `json_pretty_print'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:97:in `run_application'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'\r\n\tfrom /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'\r\n\tfrom /usr/bin/ohai:22:in `load'\r\n\tfrom /usr/bin/ohai:22:in `<main>'\r\n```\r\n\r\nLast lines of output from 'ohai -l debug':\r\n\r\n```\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_ec2_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: looks_like_ec2? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: Plugin GCE threw #<SocketError: getaddrinfo: Name or service not known>\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/mixin/gce_metadata.rb:30:in `pack_sockaddr_in'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/mixin/gce_metadata.rb:30:in `can_metadata_connect?'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:30:in `has_gce_metadata?'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:39:in `looks_like_gce?'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:43:in `block (2 levels) in <main>'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin/versionvii.rb:90:in `instance_eval'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin/versionvii.rb:90:in `run_plugin'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin.rb:98:in `run'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin.rb:169:in `safe_run'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/runner.rb:82:in `run_v7_plugin'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/runner.rb:43:in `run_plugin'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:94:in `block in run_plugins'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:93:in `each'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:93:in `run_plugins'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:71:in `all_plugins'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:90:in `run_application'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /usr/bin/ohai:22:in `load'\r\n[2015-04-14T10:22:59+02:00] DEBUG: /usr/bin/ohai:22:in `<main>'\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: has_euca_mac? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: looks_like_euca? == false\r\n[2015-04-14T10:22:59+02:00] DEBUG: NOT ohai openstack\r\n[2015-04-14T10:22:59+02:00] DEBUG: No hints present for azure.\r\n[2015-04-14T10:22:59+02:00] DEBUG: ip_scopes: cannot load gem, plugin disabled: cannot load such file -- ipaddr_extensions\r\n[2015-04-14T10:22:59+02:00] DEBUG: No data to collect for plugin SystemProfile. Continuing...\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:50:in `raise_error_for_status': Invalid UTF-8 string: cannot encode to UTF-8 (FFI_Yajl::EncodeError)\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `do_yajl_encode'\r\n\tfrom /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `encode'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:181:in `json_pretty_print'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:97:in `run_application'\r\n\tfrom /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'\r\n\tfrom /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'\r\n\tfrom /usr/bin/ohai:22:in `load'\r\n\tfrom /usr/bin/ohai:22:in `<main>'\r\n```"},"comment":{"url":"https://api.github.com/repos/chef/ohai/issues/comments/97546826","html_url":"https://github.com/chef/ohai/issues/523#issuecomment-97546826","issue_url":"https://api.github.com/repos/chef/ohai/issues/523","id":97546826,"user":{"login":"apsoto","id":11692,"avatar_url":"https://avatars.githubusercontent.com/u/11692?v=3","gravatar_id":"","url":"https://api.github.com/users/apsoto","html_url":"https://github.com/apsoto","followers_url":"https://api.github.com/users/apsoto/followers","following_url":"https://api.github.com/users/apsoto/following{/other_user}","gists_url":"https://api.github.com/users/apsoto/gists{/gist_id}","starred_url":"https://api.github.com/users/apsoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apsoto/subscriptions","organizations_url":"https://api.github.com/users/apsoto/orgs","repos_url":"https://api.github.com/users/apsoto/repos","events_url":"https://api.github.com/users/apsoto/events{/privacy}","received_events_url":"https://api.github.com/users/apsoto/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T19:11:05Z","updated_at":"2015-04-29T19:11:05Z","body":"FYI re: the ohai 8.3 that was installed on a server by chef 12.3 that is showing this problem.  \r\n\r\nI rolled it back to install chef 12.2.1 with a custom ohai 8.2 that includes the fix for #503 that isn't having this problem.  I'm not sure if a vanilla ohai 8.2 has this problem as I don't have anything available to test it on."}}