Perl: warning: Setting locale failed

Prerequisites

Volumio Information

Volumio Version:

RETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
VOLUMIO_BUILD_VERSION="168ba7444df98cd868db72f24faec0b6346489cc"
VOLUMIO_FE_VERSION="847a48ecf32d35cc502a0053d585d1a69236e391"
VOLUMIO_BE_VERSION="03f7bbd984817e093cac62b7ff876f3c2cfabc1d"
VOLUMIO_ARCH="arm"
VOLUMIO_VARIANT="volumio"
VOLUMIO_TEST="FALSE"
VOLUMIO_BUILD_DATE="Tue Dec 22 14:39:52 CET 2020"

VOLUMIO_VERSION="2.861"
VOLUMIO_HARDWARE="pi"
VOLUMIO_HASH="097e28ee6263e31d0bf6b690a02dcab3"

Steps to Reproduce

  1. Install. Choose English language
  2. Enable SSH and log in
  3. Various commands generate locale errors, e.g. sudo apt install mc (after, sudo apt update), sudo dpkg-reconfigure tzdata or I see these a lot when building software using the autotools
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_TIME = "en_GB.UTF-8",
	LC_MONETARY = "en_GB.UTF-8",
	LC_ADDRESS = "en_GB.UTF-8",
	LC_TELEPHONE = "en_GB.UTF-8",
	LC_NAME = "en_GB.UTF-8",
	LC_MEASUREMENT = "en_GB.UTF-8",
	LC_IDENTIFICATION = "en_GB.UTF-8",
	LC_NUMERIC = "en_GB.UTF-8",
	LC_PAPER = "en_GB.UTF-8",
	LANG = "en_GB.UTF-8"
    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_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Additional Information

I live in Spain, so perhaps the locale is set to British English based on my location.

Fix

Make sure the locale is included/uncommented in /etc/locale.gen and regenerate locales with sudo locale-gen

Adrian.

Issue still exists in the release version of Volumio 3

Here is an example on the command line

volumio@volumio3a:~$ sudo dpkg-reconfigure tzdata
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_ADDRESS = "en_GB.UTF-8",
	LC_NAME = "en_GB.UTF-8",
	LC_MONETARY = "en_GB.UTF-8",
	LC_PAPER = "en_GB.UTF-8",
	LC_IDENTIFICATION = "en_GB.UTF-8",
	LC_TELEPHONE = "en_GB.UTF-8",
	LC_MEASUREMENT = "en_GB.UTF-8",
	LC_TIME = "en_GB.UTF-8",
	LC_NUMERIC = "en_GB.UTF-8",
	LANG = "en_GB.UTF-8"
    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_MESSAGES 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_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

Current default time zone: 'Etc/UTC'
Local time is now:      Thu Dec  9 20:13:49 UTC 2021.
Universal Time is now:  Thu Dec  9 20:13:49 UTC 2021.

Here is an example using mc

Adrian.

This happens only when using a terminal for some background work, which is not a typical Volumio use case.
I think the Volumio Team did/ does not see this as an urgent issue to resolve.

I recall fixing this. :expressionless:
Perhaps it was one some other branch somewhere that never made it into the new repo…

Hi gkkpch

Thanks for the reply.

The warning is simply an annoyance in scrolling output, but in mc I found the big red “error” was covering the dialogue where I had to confirm/select some action on files. It is a new installation, so I didn’t care if I made the wrong choice, but there is definitely some potential for breaking a working installation!

Looking more at the source of the issue, I am logging in with ssh and having my current locale used, which is en_GB.UTF-8, and this then is not available on the Volumio machine, hence the warning.

There is some more information in the following thread

I think it would be helpful to mention this issue in the Volumio docs about logging in with ssh, and also say how to stop the warning being printed if this should occur. I don’t think any changes are needed to Volumio itself.

Adrian.

We have a topic “Guides” in the Help section, I would say “go for it!” instead of waiting for someone else doing it :wink:

Yes, this is done to save some space in the rootfs :slight_smile:

+1 to what Gé said – could you also add a note here GitHub - volumio/volumio-developers-docs

EDIT: This would be exact file volumio-developers-docs/ssh.md at master · volumio/volumio-developers-docs · GitHub

Hi gkkpch

I don’t think a guide will help.

Adrian.

Hi ashthespy

Thanks for the suggestion. That is the page I thought the extra information should go. However, it would be easier for the dev team to add some text, if they want to include it, rather than for me to submit a PR which may well be ignored.

Adrian.

I completely understand your sentiments very well with long standing open PRs with Volumio, but this repo should go relatively quick! :slight_smile:

Up to you in the end of course!