Setting locale failed when configuring a snap polluting the config output

Bug #1519602 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
High
Unassigned

Bug Description

I tried to install a snap config-example from Snappy store by running the following command:

(amd64)ubuntu@localhost:~$ sudo snappy install config-example

Then, I am trying to config the example by having the following commands:

(amd64)ubuntu@localhost:~$ cat > cfg.yaml <<'EOF'
> config:
> config-example:
> msg: |
> Yay!
> EOF
(amd64)ubuntu@localhost:~$ vi cfg.yaml
(amd64)ubuntu@localhost:~$ ls
apps cfg.yaml
(amd64)ubuntu@localhost:~$ sudo snappy config config-example cfg.yaml
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LC_TELEPHONE = "zh_CN.UTF-8",
 LC_IDENTIFICATION = "zh_CN.UTF-8",
 LC_MONETARY = "zh_CN.UTF-8",
 LC_NAME = "zh_CN.UTF-8",
 LC_ADDRESS = "zh_CN.UTF-8",
 LC_MEASUREMENT = "zh_CN.UTF-8",
 LC_NUMERIC = "zh_CN.UTF-8",
 LC_TIME = "zh_CN.UTF-8",
 LC_PAPER = "zh_CN.UTF-8",
 LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").
config:
  config-example:
    msg: 'Yay!

      '
I get Setting locale failed error. What is the problem for it?

Thanks & best regards,
XiaoGuo

Michael Vogt (mvo)
Changed in snappy:
status: New → Triaged
importance: Undecided → High
summary: - Setting locale failed when configuring a snap
+ Setting locale failed when configuring a snap polluting the config
+ output
Revision history for this message
Michael Vogt (mvo) wrote :

This is indeed an issue especially since it appears that perl is outputing these warning on stdout and not on stderr :/

As a workaround:
  $ LC_ALL=C.UTF-8 LANGUAGE=en ssh -p 8022 ubuntu@localhost
can be used.

Revision history for this message
Stuart Bishop (stub) wrote :

I also find I need to set the LOCPATH environment variable (this with the locales-all package in stage packages):

stub@uurp:/home/stub$ 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_AU.UTF-8
LANGUAGE=en_AU:en_GB:en_US:en
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC=en_AU.UTF-8
LC_TIME=en_AU.UTF-8
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY=en_AU.UTF-8
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER=en_AU.UTF-8
LC_NAME=en_AU.UTF-8
LC_ADDRESS=en_AU.UTF-8
LC_TELEPHONE=en_AU.UTF-8
LC_MEASUREMENT=en_AU.UTF-8
LC_IDENTIFICATION=en_AU.UTF-8
LC_ALL=
stub@uurp:/home/stub$ export LOCPATH=$SNAP/usr/lib/locale
stub@uurp:/home/stub$ locale
LANG=en_AU.UTF-8
LANGUAGE=en_AU:en_GB:en_US:en
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC=en_AU.UTF-8
LC_TIME=en_AU.UTF-8
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY=en_AU.UTF-8
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER=en_AU.UTF-8
LC_NAME=en_AU.UTF-8
LC_ADDRESS=en_AU.UTF-8
LC_TELEPHONE=en_AU.UTF-8
LC_MEASUREMENT=en_AU.UTF-8
LC_IDENTIFICATION=en_AU.UTF-8
LC_ALL=

stub@uurp:/home/stub$ LC_ALL=zh_TW.utf8 locale
LANG=en_AU.UTF-8
LANGUAGE=en_AU:en_GB:en_US:en
LC_CTYPE="zh_TW.utf8"
LC_NUMERIC="zh_TW.utf8"
LC_TIME="zh_TW.utf8"
LC_COLLATE="zh_TW.utf8"
LC_MONETARY="zh_TW.utf8"
LC_MESSAGES="zh_TW.utf8"
LC_PAPER="zh_TW.utf8"
LC_NAME="zh_TW.utf8"
LC_ADDRESS="zh_TW.utf8"
LC_TELEPHONE="zh_TW.utf8"
LC_MEASUREMENT="zh_TW.utf8"
LC_IDENTIFICATION="zh_TW.utf8"
LC_ALL=zh_TW.utf8

Michael Vogt (mvo)
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.