sensu/sensu-puppet

Puppet Agent Fails Due to invalid multibyte char (US-ASCII)

mvsm opened this issue · 2 comments

mvsm commented

Description of problem

When using this module on Debian Servers with UTF-8 locales set, errors are raised regarding characters not present in UTF-8 charset.

Expected Behavior

Puppet run finishes without errors

Current Behavior

During the puppet run, the catalog is not compiled due to an error from non-UTF-8 characters.

Info: Using configured environment 'feature_add_sensugo'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error while evaluating a Type-Name, Could not autoload puppet/type/sensu_user: /etc/puppetlabs/code/environments/feature_add_sensugo/modules/sensu/lib/puppet/type/sensu_user.rb:85: invalid multibyte char (US-ASCII) at /etc/puppetlabs/code/environments/feature_add_sensugo/modules/sensu/manifests/backend/tessen.pp:20:7 on node rtesrv5.reliant","issue_kind":"RUNTIME_ERROR","stacktrace":["Warning: The 'stacktrace' property is deprecated and will be removed in a future version of Puppet. For security reasons, stacktraces are not returned with Puppet HTTP Error responses."]}
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Steps to Reproduce

  1. Puppet Server on a Debian machine configured with the module and LANG=en_US.UTF-8 as the system locale.
  2. Generate types (it will show errors regarding the chars not in UTF-8)
  3. Execute puppet agent on a debian node.

Command used and debugging output

Master based puppet setup.

Platform and version information

  • Your OS: Debian Jessy 8.7
  • Your Ruby version: 2.1.5p273
  • Your version of Puppet: 4.10.12
  • Your version of Sensu: 5.14.1-6721
  • Your version of this module: v3.8.0 and v4.5.1

Anything else to add that you think will be helpful?

Possible Solution: Remove char ’ from the code.

Links:

desc "Assets to be applied to the filter’s execution context."

desc "If the Sensu agent writes JSON serialized Sensu entity and check data to the command process’ STDIN."

desc "The state of the user’s account."

The fix is simple but FYI that we don't officially support Puppet 4, only Puppet >= 5.0.0. I think Puppet 4 is also EOL. I'd recommend updating your Puppet install.

mvsm commented

Thanks for the advice, we are migrating but it is a work in progress. Regardless, I did a PR with the fix. Thanks for the fast reply btw.