cloud-images don't accept LANG settings

Bug #920601 reported by Ben Howard on 2012-01-23
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu
Critical
Ben Howard

Bug Description

The cloud images currently only support "en_US.UTF-8" locales in Oneiric and Precise by default unless a user sets the locale via cloud-config in cloud-init. Users who SSH into a cloud-image with LANG="<SOMETHING ELSE>" will have the LANG setting ignored. On Precise if the LANG is invalid, then the environment will reflect the invalid language; if the LANG is valid, then it will be ignored.

IMHO, this is a poor user experience for international users. We either need to turn off "Accept LC_*" in /etc/sshd/config, install (and thus bloat the images) all the language packs or come up with a way to dynamically install the the languages.

Example:
LANG="en_GB.UTF-8" ssh ec2-23-20-37-252.compute-1.amazonaws.com
Warning: Permanently added 'ec2-23-20-37-252.compute-1.amazonaws.com' (ECDSA) to the list of known hosts.
Welcome to Ubuntu precise (development branch) (GNU/Linux 3.2.0-10-virtual i686)

ubuntu@domU-12-31-39-16-C8-46:~$ locale
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=

ubuntu@domU-12-31-39-16-C8-46:/home/ubuntu$ locale -a
C
C.UTF-8
en_US.utf8
POSIX

----

Invalid LANG setting -- the following example is SSH'ing with an invalid LANG="?". Notice that the LANG is reflected in the environment. In this case /etc/default/locale has 'LANG="en_US.UTF-8"' set.

ben@padfoot:~/Desktop$ LANG="en_GB.UTF-8" ssh ec2-23-20-37-252.compute-1.amazonaws.com
Welcome to Ubuntu precise (development branch) (GNU/Linux 3.2.0-10-virtual i686)

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
...

ubuntu@domU-12-31-39-16-C8-46:~$ sudo locale-gen en_GB.UTF-8
Generating locales...
  en_GB.UTF-8... done
Generation complete.
ubuntu@domU-12-31-39-16-C8-46:~$ exit

ben@padfoot:~/Desktop$ LANG="en_GB.UTF-8" ssh ec2-23-20-37-252.compute-1.amazonaws.com
Welcome to Ubuntu precise (development branch) (GNU/Linux 3.2.0-10-virtual i686)

ubuntu@domU-12-31-39-16-C8-46:~$ locale
LANG=en_US.UTF-8
..

Related Bugs:
 * bug 859814: Locale issues with beta-1/2 cloud-images

Ben Howard (darkmuggle) on 2012-01-23
Changed in ubuntu:
assignee: nobody → Ben Howard (utlemming)
importance: Undecided → High
Ben Howard (darkmuggle) wrote :

After talking with smoser, this is getting tabled pending a discussion with Foundations.

description: updated
Changed in ubuntu:
importance: High → Low

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/920601/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment

Attempting to change the bug description, but launchpad seems to be erroring out. Here is what I want the description to be:
----

The cloud images currently only support "en_US.UTF-8" locales in Oneiric and Precise by default unless a user sets the locale via cloud-config in cloud-init. Users who SSH into a cloud-image with LANG="<SOMETHING ELSE>" will have an invalid LANG seting.

IMHO, this is a poor user experience for international users. We either need to turn off "Accept LC_*" in /etc/sshd/config, installed (and thus bloat the images) all the language packs or come up with a way to dynamically install the the languages.

Example:
LANG="en_GB.UTF-8" ssh ec2-23-20-37-252.compute-1.amazonaws.com
Warning: Permanently added 'ec2-23-20-37-252.compute-1.amazonaws.com' (ECDSA) to the list of known hosts.
Welcome to Ubuntu precise (development branch) (GNU/Linux 3.2.0-10-virtual i686)

ubuntu@domU-12-31-39-16-C8-46:~$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE=en_US.UTF-8
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

ubuntu@domU-12-31-39-16-C8-46:/home/ubuntu$ locale -a
C
C.UTF-8
en_US.utf8
POSIX

Ben Howard (darkmuggle) wrote :

Part of the problem is /etc/pam.d/sshd:

auth required pam_env.so # [1]
auth required pam_env.so envfile=/etc/default/locale

The last line reads the locale settings and sets $LANG, which overrides the language settings and prevents users from changing their language. In order to make this work, /etc/pam.d/sshd will have to be changed, which will let users use a non-system default language.

description: updated
Ben Howard (darkmuggle) on 2012-01-24
summary: - cloud-images don't understand other locales in precise
+ cloud-images don't accept LANG settings
description: updated
Ben Howard (darkmuggle) on 2012-03-15
Changed in ubuntu:
importance: Low → Critical
status: New → Confirmed
Ben Howard (darkmuggle) wrote :

The plan here is to produce a /etc/profile.d or /etc/ssh/sshrc file that identifies an incorrect lang setting. I've prototyped the functionality, and am currently testing it. Right now I am torn about where to put it. I like using an /etc/ssh/sshrc (which calls commands) since it would limit the scope only to SSH sessions, but /etc/profile.d seems more standard.

Scott Moser (smoser) on 2012-03-30
description: updated
Ben Howard (darkmuggle) on 2012-12-03
Changed in ubuntu:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers