puppet-rabbitmq: not working with rabbitmq-server 3.7 - Cannot parse invalid user line

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.3.3-1xenial
  • Ruby: ruby2.4 (included in puppet package)
  • Distribution: Ubuntu 16.04.3 LTS
  • Module version: v8.0.0
  • Rabbitmq-server : 3.7.0-1

How to reproduce (e.g Puppet code you use)

just run puppet agent -t

      rabbitmq_user { 'new_user':
                admin    => true,
                password => 'pass',
                provider => 'rabbitmqctl'
        }

What are you seeing

Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)

What behaviour did you expect instead

something went wrong with name encoding when the module is trying to fetch the result of the command: /usr/sbin/rabbitmqctl -q list_users

the function itself is located in this file line 22: ./lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb

Output log

Debug: Executing: '/usr/sbin/rabbitmqctl -q list_users'
Debug: Command succeeded
Debug: Storing state
Debug: Stored state in 0.16 seconds
Error: Failed to apply catalog: Cannot parse invalid user line: warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Debug: Dynamically-bound server lookup failed, falling back to report_server setting

Any additional information you’d like to impart

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 23 (6 by maintainers)

Commits related to this issue

Most upvoted comments

class {'rabbitmq':
  environment_variables => {
    'LC_ALL' => 'en_GB.UTF-8',
  }
}

Gets around this issue

See rabbitmq/rabbitmq-cli#273 for details on how to solve this issue.

So the issue is not resolved for new rabbitmq.

I wonder if there’s a good fix to this that’s clean but avoids explicitly hard coding locales / env variables. Maybe we could capture stderr from the command and only print it in the output it if the command fails?

@mUbsta thank you very much, you have saved my life here.