Open FlogFr opened 8 years ago
Let's see, are you saying en_US.utf8 comes from /usr/share/lxc/template/lxc-debian ?
If not, where does it comes from ? Cause that's probably something we need to patch.
I have nothing against fixing it here although it's too bad it would only benefit our users, it seems like a bigger issue.
the "wrong" environement variable (en_US.utf8) comes from my ~/.bashrc
.
But at the container creation it doesn't check that the LANG environment variable is a good one for the locale, maybe it is in the lxc template that should be fixed in order to fallback to a default good locale.
Perhaps it should just fail if the LANG is not right ?
How do you suggest to check that LANG is correct ?
I don't know if the creation of a container should fail because a locale is not properly set. And I don't know how to pre-check that the LANG is available in the locale.
I'm missing something here, my locale seems properly set but locale -a shows en_US.utf8
02/08 2016 15:20:24 jpic@lue ~
$ cat /etc/locale.gen | grep en_US
# en_US ISO-8859-1
# en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
#en_US ISO-8859-1
02/08 2016 15:20:28 jpic@lue ~
$ cat /etc/locale.conf
LANG=en_US.UTF-8
02/08 2016 15:20:35 jpic@lue ~
$ echo $LANG
en_US.UTF-8
02/08 2016 15:20:42 jpic@lue ~
$ locale
LANG=en_US.UTF-8
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=
02/08 2016 15:20:43 jpic@lue ~
$ locale -a
C
en_US.utf8 <------------- WTF ?
POSIX
@aRkadeFR could you paste the output when it's not properly set for you please ? I'm making a case for serverfault so we can get to the bottom of this.
Thxxxx
:guitar:
Yes, locale -a
shows en_US.utf8
but I set manually LANG to en_US.utf8
. This is a wrong $LANG
env variable.
I've run into the same error message, but from a different route (just using locale-gen while tracking down an issue with postgresql):
{17-01-02 12:53}hostname:/opt@master✗✗✗✗✗✗ root# locale-gen
Generating locales (this might take a while)...
en_US.ISO-8859-1... done
en_US.utf8...character map file `utf8' not found: No such file or directory
done
Generation complete.
Interestingly, @aRkadeFR you opened another ticket here for a different project, that I believe is directly related.
For me this was on a fresh LXC Debian jessie container, with only a few other packages installed. The culprit is /etc/locale.gen contains:
# (lots of commented out stuff, finally ending with:)
en_US.utf8 utf8
utf8
isn't a valid character map file. /etc/local.gen should contain this instead:
en_US.utf8 UTF-8
After making that correction locale-gen can correctly generate locale information. I believe this is the root cause of this issue.
What's interesting though, and could mean that I am wrong, is that @jpic it looks like your local.gen contains:
en_US.UTF-8 UTF-8
I'm not sure who "owns" the source of this bug, if it is something with debconf, something with the locales package, or what, but I'm hoping either of you in this thread might help report this to the correct maintainer so it can be fixed.
Cheers, DG
Couldn't find utf8
in a fresh jessie container's /etc/locale.gen with lxc 2.0.6:
root@jessie:/# /bin/grep -v '^#' /etc/locale.gen
en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
root@jessie:/#
@decidedlygray could you report your LXC version and exact lxc-create command to reproduce this ?
Hmm.. Ok, I think I'm wrong then and this might be specific to my setup.
Not entirely sure how to get lxc version info, but I think it's this?:
root@hostname:cache/debconf # lxc-info --version
1.1.5
I'm on a system that uses custom templates to deploy LXC containers, so I don't have the exact lxc-create command. I might be a lost cause.. sorry
@decidedlygray you actually pointed the right issue IMHO
Some of my colleagues and me got en_US.utf8 UTF-8
in their host /etc/locale.gen
, which is not LXC related but from the debian setup. Not sure how to reproduce this setup with wrong values on /etc/locale.gen
.
I may suspect that this value was a correct on old setup (wheezy / beginning jessie) and while upgrading these values are not replaced.
Hey there,
thanks for this awesome work and role first :)
When you don't set correctly your LANG variable on your host, the container creation will dump a msg of error of type:
If you correctly set the LANG variable to a correct locale + encoding (like
en_US.UTF-8
), the container creation will be ok, and dump a successful message:I'm under jessie, with the default
/usr/share/lxc/template/lxc-debian
file.novafloss.boot could try to check if the LANG is correct, if not, then fallback to en_US.UTF-8 as default ?