rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.04k stars 3.9k forks source link

Elixir warning when locale is not UTF-8 #1572

Closed wyardley closed 6 years ago

wyardley commented 6 years ago

When certain locale settings are not UTF-8, rabbitmqctl returns a warning (even with the -q option).

This has caused problems with config management software that calls the shell commands and parses the output; while this can be fixed, is UTF-8 actually required? Forcing the env to a specific locale seems a bit drastic, so I wonder if there's a way to suppress this warning, especially when -q is used. https://github.com/voxpupuli/puppet-rabbitmq/issues/671 https://github.com/saltstack/salt/issues/45383

root@ubuntu-server-1604-x64:~# locale
LANG=C
LANGUAGE=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
root@ubuntu-server-1604-x64:~# rabbitmqctl list_users
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)
michaelklishin commented 6 years ago

This is an Elixir requirement, not that of RabbitMQ CLI tools (which are in https://github.com/rabbitmq/rabbitmq-cli, by the way).

There are no plans to switch away from using Elixir for CLI tools.

michaelklishin commented 6 years ago

Configuration software that uses CLI tools can override locale environment variables for the calls that where parsing the output is warranted:

LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" rabbitmqctl …

as a workaround. We will consider forcing this in our shell scripts (filed https://github.com/rabbitmq/rabbitmq-server/issues/1573 for that with a more specific problem statement) but IIRC this has been considered before and rejected.