[SOLVED] perl: warning: Setting locale failed.

LooneyTunes

Active Member
Jun 1, 2019
203
22
38
Hi,

I have noticed a problem with locales on my server when patching it. It says "LC_ALL" variable is not set, which I think is as should be, also according to the Debian Wiki;
Using LC_ALL is strongly discouraged as it overrides everything. Please use it only when testing and never set it in a startup file.
So, I wonder, does this have any negative effect on anything? Everything seems to work as I expect it to, all other LC_* are set correctly, including $LANG, but I'd rather not have to see this error/warning everytime I patch... I have seen advice editing /root/.bashrc, but that feels more like a workaround than a solution. Please advice.

Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
[snip]
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!

I am using pve 7.0-11.

Thanks
 
Does this happen on the PVE node itself? - Then I'd assume it was installed on top of a plain debian install?

usually these warnings disappear once you've configured at least one locale on the system:
`dpkg-reconfigure locales`
(select at least one e.g. en_US.UTF-8)
and select that as default in the next step

I hope this helps!
 
  • Like
Reactions: mjw
Hi,
thanks for the quick reply!

My install was done bare metal, using an ISO from the Proxmox site. I just SSH'd into it and issued the command above, and indeed, 'en_US.UTF-8' is already configured. As the instructions above was for proxmox on top of debian, I aborted. Should I go through with it anyway?
 
My install was done bare metal, using an ISO from the Proxmox site. I just SSH'd into it and issued the command above, and indeed, 'en_US.UTF-8' is already configured. As the instructions above was for proxmox on top of debian, I aborted. Should I go through with it anyway?
It should not cause any problems - so yes - please run `dpkg-reconfigure locales`
 
Ok, I noticed I did get the warning when lauching the command, but after regenerating locales, it's no longer shown, so seems all good now. Thanks so much! :)
 
  • Like
Reactions: Stoiko Ivanov
@Stoiko Ivanov even if it's an old threat, the issue beyond of that is a still existing, even 2 years after.
Do you maybe think it may be possible, to apply a general solution?
So that the First User Experience would be the same as it would run natively? ;-)
 
@Stoiko Ivanov even if it's an old threat, the issue beyond of that is a still existing, even 2 years after.
Do you maybe think it may be possible, to apply a general solution?
So that the First User Experience would be the same as it would run natively? ;-)
Not quite certain how a general solution would look like in this case.
If you install on top of debian and run through almost any debian installer the locales package is correctly setup for your system and the issue
does not appear

If you don't install the locales package or do not configure it in your installation procedure it's not really something we can run for you - this is
a task for the system administrator - not someone shipping software for the distribution

I hope this helps!
 
Agreed a general solution to set something would be hard, but something is obviously overwriting this at times. It's been a while for me now though :)
Could a config file and a udev-rule to set it if unset be used perhaps?
 
Agreed a general solution to set something would be hard, but something is obviously overwriting this at times. It's been a while for me now though :)
Could a config file and a udev-rule to set it if unset be used perhaps?
i would submit, that there should be a solution, I mean not only professional User uses this product.
 
  • Like
Reactions: mjw
If you don't install the locales package or do not configure it in your installation procedure it's not really something we can run for you - this is
a task for the system administrator - not someone shipping software for the distribution
Yet you can set the locale on installation based on the country, can't you?

We use this in Docker to localize (DE and EN), so that may also work in the PVE install:

Code:
export DEBIAN_FRONTEND=noninteractive

dpkg-reconfigure tzdata locales
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
echo 'LANG="en_US.UTF-8"'>/etc/default/locale
dpkg-reconfigure locales
update-locale LANG=en_US.UTF-8
 
  • Like
Reactions: djdomi
I'd argue that "en_US.UTF-8" should be installed and set as the default on a server-system.
 
I'd argue that "en_US.UTF-8" should be installed and set as the default on a server-system.

Please keep in mind that we are still experiencing this problem even after a fresh installation of Proxmox.

In my humble opinion, a general solution from the vendor is needed instead of an individual person addressing it.
 
  • Like
Reactions: mjw
# Setting for the new UTF-8 terminal support in Debian, run the following:
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
 

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!