LXC - perl: warning: Setting locale failed.

Sokaris07

Active Member
Jan 20, 2017
3
0
41
33
Hello,
I have a problem on my LXC containers:
Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
  LANGUAGE = (unset),
  LC_ALL = (unset),
  LANG = "en_US.UTF-8"
  are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").



root@vm:~# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX


root@vm:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Tried a bunch of things found on Google but none of them solved.
This don't happen on any of the hosts.

Code:
root@host:~# locale -a
C
C.UTF-8
en_US.utf8
POSIX


root@host:~# locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


proxmox-ve: 4.4-76 (running kernel: 4.4.35-1-pve)
pve-manager: 4.4-1 (running version: 4.4-1/eb2d6f1e)
pve-kernel-4.4.35-1-pve: 4.4.35-76
lvm2: 2.02.116-pve3
corosync-pve: 2.4.0-1
libqb0: 1.0-1
pve-cluster: 4.0-48
qemu-server: 4.0-101
pve-firmware: 1.1-10
libpve-common-perl: 4.0-83
libpve-access-control: 4.0-19
libpve-storage-perl: 4.0-70
pve-libspice-server1: 0.12.8-1
vncterm: 1.2-1
pve-docs: 4.4-1
pve-qemu-kvm: 2.7.0-9
pve-container: 1.0-88
pve-firewall: 2.0-33
pve-ha-manager: 1.0-38
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u2
lxc-pve: 2.0.6-2
lxcfs: 2.0.5-pve1
criu: 1.6.0-1 novnc-pve: 0.5-8
smartmontools: 6.5+svn4324-1~pve80
zfsutils: 0.6.5.8-pve13~bpo80
 
Tried a bunch of things found on Google but none of them solved.

That was one of them and nothing... Tried to edit .bashrc too and nothing. I've been struggling with this for a while and only happened after moving to Proxmox 4 (clear install)

EDIT: That fixes me the problem on Ubuntu but not on Debian
 
What's the output of a simple `locale-gen` run (as root) without any extra parameters and what's in your /etc/locale.conf?
 
What's the output of a simple `locale-gen` run (as root) without any extra parameters and what's in your /etc/locale.conf?

Code:
root@vm:~# locale-gen
Generating locales (this might take a while)...
Generation complete.
root@vm:~# cat /etc/locale.conf
cat: /etc/locale.conf: No such file or directory
 
try running "dpkg-reconfigure locales" (as root) and select the appropriate locale(s).
 
I'm having same problem, with latest Proxmox, I configure locale via debian default locale configurator
Code:
dpkg-reconfigure locales
. But after I reboot container it goes back to how it was. And same perl and python errors appear.

Code:
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
ensuring ssl_dh
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MEASUREMENT = "lt_LT.UTF-8",
    LC_PAPER = "lt_LT.UTF-8",
    LC_MONETARY = "lt_LT.UTF-8",
    LC_NAME = "lt_LT.UTF-8",
    LC_ADDRESS = "lt_LT.UTF-8",
    LC_NUMERIC = "lt_LT.UTF-8",
    LC_TELEPHONE = "lt_LT.UTF-8",
    LC_IDENTIFICATION = "lt_LT.UTF-8",
    LC_TIME = "lt_LT.UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I setup two locales en_US and lt_LT
 
please post the output of:
* `grep -v '^#' /etc/locale.gen`
* `set |grep -Ei 'lang|lc'`
run inside the container
 
This problem exist on an fresh pve install.

Code:
root@backup:~# uname  -a
Linux backup 4.15.18-12-pve #1 SMP PVE 4.15.18-35 (Wed, 13 Mar 2019 08:24:42 +0100) x86_64 GNU/Linux
root@backup:~# pveversion
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "de_AT.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
pve-manager/5.3-11/d4907f84 (running kernel: 4.15.18-12-pve)
dpkg-reconfigure locales solves the problem. But i think it is a good idea that problem should fixed in a fresh installation. ;)
 
  • Like
Reactions: japi
@fireon: are you accessing the fresh pve install via ssh from a session where you have a locale set (on your laptop/ssh-client), which is not configured on the pve server? - or are you accessing the node's console directly? (if yes - did you set a locale somewhere in your shell's rc files?)
 
the issue is still persistent on Debian 10, at least, but it is also an issue from the lxc image side, Proxmox is not responsible of these image, Proxmox only pull these image from LinuxContainer. It might worth it to discuss about this on their forum: https://discuss.linuxcontainers.org.

the only way I figure to fix this is by reinstalling locales in the LXContainer such as:

Bash:
apt install --reinstall --purge locales
dpkg-reconfigure locales
 
Last edited:
the issue is still persistent on Debian 10, at least, but it is also an issue from the lxc image side, Proxmox is not responsible of these image, Proxmox only pull these image from LinuxContainer. It might worth it to discuss about this on their forum: https://discuss.linuxcontainers.org.

the only way I figure to fix this is by reinstalling locales in the LXContainer such as:

Bash:
apt install --reinstall --purge locales
dpkg-reconfigure locales
This also does not work here (Debian 10 LXC):

Code:
$ apt install --reinstall --purge locales
$ dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_CTYPE = "en_US.UTF-8",
        LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_CTYPE = "en_US.UTF-8",
        LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!