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

Always got "Please ensure your locale is set to UTF-8" #3548

Closed
jsvisa opened this issue Aug 5, 2015 · 4 comments
Closed

Always got "Please ensure your locale is set to UTF-8" #3548

jsvisa opened this issue Aug 5, 2015 · 4 comments

Comments

@jsvisa
Copy link
Contributor

jsvisa commented Aug 5, 2015

My locale is set as below:

LANG=
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=C

When I run iex, it always got

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)

I don't know how to avoid it.

@josevalim
Copy link
Member

You need to set those variables properly. Here is how it looks in my machine:

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

See this Stack Overflow answer for more ideas. Finally, please use the mailing list or stack overflow for questions.

@josevalim
Copy link
Member

You need to set at least LANG and LC_CTYPE.

@jsvisa
Copy link
Contributor Author

jsvisa commented Aug 5, 2015

Thanks @josevalim , I'll check it now

openstack-gerrit pushed a commit to openstack-archive/puppet-tripleo that referenced this issue Apr 2, 2019
When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does):

  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)

This is fundamentally the tripleo version of
voxpupuli/puppet-rabbitmq#671

This is a strict requirement coming from Elixir:
elixir-lang/elixir#3548

Since containers do not have UTF-8 as a default we have this problem:
[root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh
()[root@overcloud-controller-0 /]$ rabbitmqctl -q 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 ru nning "locale" in your shell) user tags
guest [administrator]
()[root@overcloud-controller-0 /]$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Related-Bug: #1822673
Change-Id: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Apr 2, 2019
* Update puppet-tripleo from branch 'master'
  - Merge "Force C.UTF-8 when dealing with rabbitmq"
  - Force C.UTF-8 when dealing with rabbitmq
    
    When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does):
    
      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)
    
    This is fundamentally the tripleo version of
    voxpupuli/puppet-rabbitmq#671
    
    This is a strict requirement coming from Elixir:
    elixir-lang/elixir#3548
    
    Since containers do not have UTF-8 as a default we have this problem:
    [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh
    ()[root@overcloud-controller-0 /]$ rabbitmqctl -q 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 ru nning "locale" in your shell) user tags
    guest [administrator]
    ()[root@overcloud-controller-0 /]$ locale
    LANG=
    LC_CTYPE="POSIX"
    LC_NUMERIC="POSIX"
    LC_TIME="POSIX"
    LC_COLLATE="POSIX"
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=
    
    Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
    Related-Bug: #1822673
    Change-Id: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Apr 2, 2019
* Update tripleo-heat-templates from branch 'master'
  - Merge "Force C.UTF-8 when dealing with rabbitmq"
  - Force C.UTF-8 when dealing with rabbitmq
    
    When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does):
    
      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)
    
    This is fundamentally the tripleo version of
    voxpupuli/puppet-rabbitmq#671
    
    This is a strict requirement coming from Elixir:
    elixir-lang/elixir#3548
    
    Since containers do not have UTF-8 as a default we have this problem:
    [root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh
    ()[root@overcloud-controller-0 /]$ rabbitmqctl -q 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 ru nning "locale" in your shell) user tags
    guest [administrator]
    ()[root@overcloud-controller-0 /]$ locale
    LANG=
    LC_CTYPE="POSIX"
    LC_NUMERIC="POSIX"
    LC_TIME="POSIX"
    LC_COLLATE="POSIX"
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=
    
    This is the THT version of forcing UTF-8 on all rabbitmq_init_bundles
    and on epmd itself. The puppet-tripleo one is the depends-on:
    Depends-on: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
    
    Tested on the original environment from Emilien where we saw this issue
    during scale-up. After appling this review and its dependency we
    correctly got a scaleup with rabbitm3.7 working
    
    Closes-Bug: #1822673
    Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
    Change-Id: Ifc1377811de68bf14ea4aea4dfb52e22a8864d46
openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this issue Apr 2, 2019
When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does):

  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)

This is fundamentally the tripleo version of
voxpupuli/puppet-rabbitmq#671

This is a strict requirement coming from Elixir:
elixir-lang/elixir#3548

Since containers do not have UTF-8 as a default we have this problem:
[root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh
()[root@overcloud-controller-0 /]$ rabbitmqctl -q 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 ru nning "locale" in your shell) user tags
guest [administrator]
()[root@overcloud-controller-0 /]$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

This is the THT version of forcing UTF-8 on all rabbitmq_init_bundles
and on epmd itself. The puppet-tripleo one is the depends-on:
Depends-on: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d

Tested on the original environment from Emilien where we saw this issue
during scale-up. After appling this review and its dependency we
correctly got a scaleup with rabbitm3.7 working

Closes-Bug: #1822673
Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Change-Id: Ifc1377811de68bf14ea4aea4dfb52e22a8864d46
@eksperimental
Copy link
Contributor

You need to set those variables properly. Here is how it looks in my machine:
...
LC_ALL="en_US.UTF-8"

Just for the record. I don't think you should set LC_ALL in your config files, as it overrides everything. If you had set every other LC_ env variable, there is no need for LC_ALL, and actually they will be overriden.

Reference: https://wiki.debian.org/Locale

Warning! Using LC_ALL is strongly discouraged as it overrides everything. Please use it only when testing and never set it in a startup file.

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

No branches or pull requests

3 participants