Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale-related errors: Cannot set LC_ALL to default locale: No such file or directory #7

Open
javornikolov opened this issue Dec 26, 2013 · 24 comments
Labels

Comments

@javornikolov
Copy link
Contributor

I'm getting some locale-related errors (from vagrant OS account) like locale: Cannot set LC_ALL to default locale: No such file or directory. Perhaps that's due to the manual cleanup during the setup.

e.g.:

[vagrant@vagrant-centos65 ~]$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_DK.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=
@javornikolov
Copy link
Contributor Author

I fixed that by yum reinstall glibc-common. Consumed about 95MB disk space but I prefer not to have locale-related problems and errors.

@casr
Copy link
Member

casr commented Dec 27, 2013

I prefer not to have locale-related problems and errors

Yup totally agree but I want to balance the size of the box too. I have been a bit careless in this regard. Going forward I think a "safe to delete" list would be better than a "blindly deleting anything not related to en_US".

Thanks for the report!

@javornikolov
Copy link
Contributor Author

In addition to en_US I see en_DK is used by default for LC_TIME.

Some related discussion here: https://bugzilla.redhat.com/show_bug.cgi?id=156477

@casr
Copy link
Member

casr commented Dec 27, 2013

Without deleting any of the locales I get this output on a freshly installed system:

[root@vagrant-centos65 ~]$ 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=

en_DK didn't appear for the LC_TIME. Is there something specific to your setup perhaps?

@javornikolov
Copy link
Contributor Author

Hmm. I'm not sure how I ended up with such settings. One diff I can see is that I ran locale with vagrant user.

@casr
Copy link
Member

casr commented Dec 27, 2013

Yeah I thought about that after but got the same result. Peculiar!

@casr
Copy link
Member

casr commented Dec 27, 2013

locale: Cannot set LC_ALL to default locale: No such file or directory

I can't reproduce this at the moment. Are there any steps I can follow to replicate?

@javornikolov
Copy link
Contributor Author

On my host OS I have LC_TIME=en_DK.UTF-8. To be fair - now I'm not sure if I used your box image directly or is some my experiments to build it locally. (But I remember I had the locale error with some of the public images too, just I'm not sure if it was yours). I'll try again to reproduce it.

@javornikolov
Copy link
Contributor Author

I managed to reproduce the issue - it's indeed about the locales on the host OS. Seems locale settings are replicated when doing vagrant ssh.

[host]$ export LC_TIME=en_DK.UTF-8
[host]$ vagrant ssh               
Last login: Sat Dec 28 21:23:18 2013 from 10.0.2.2
[vagrant@vagrant-centos65 ~]$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_DK.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=
[vagrant@vagrant-centos65 ~]$ exit
logout
Connection to 127.0.0.1 closed.
[host] $ export LC_TIME=en_US.UTF-8
[host] $ vagrant ssh
Last login: Sat Dec 28 21:23:42 2013 from 10.0.2.2
[vagrant@vagrant-centos65 ~]$ 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=

Same happens even if I connect through the redirected port: ssh vagrant@localhost -p 2222.

Then I checked /etc/ssh/ssh_config (on the vagrant box):

# Send locale-related environment variables
    SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
    SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
    SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
    SendEnv XMODIFIERS

So that replicating of some env variables appears to be a standard feature of ssh.

@javornikolov
Copy link
Contributor Author

Maybe would be enough to put a note in README that the VM comes with en_US locale only. And maybe some guidelines how to add other locales if needed.

@casr
Copy link
Member

casr commented Jan 13, 2014

There is a small note already. I would like to resolve this issue as much as possible by hopefully not sacrificing the size of the box too much and for the common case. I haven't forgotten about it! :)

I was experimenting with deleting /usr/share/locale/*/LC_MESSAGES and keeping the LC_TIME part. I'm guessing that would alleviate this specific problem you are having. Do you think there might be any other problems related to locale errors (aside from the lack of language support, of course)? Most importantly I don't want programmes to malfunction which I suspect could happen when you don't have LC_TIME.

@casr
Copy link
Member

casr commented Jan 14, 2014

I think I'm happy with the solution above. Could you give it a go and see how it works out for you? I've uploaded a box that's been built with it.

https://github.com/2creatives/vagrant-centos/releases/download/untagged-6e6bed330370d38c148b/centos65-x86_64-locale-test.box

@javornikolov
Copy link
Contributor Author

Hmm, for some reason that db-link doesn't work for me. I mean - error 404.

@casr
Copy link
Member

casr commented Jan 14, 2014

Must just work for me because I am signed in. Shame! I've uploaded it over here instead: http://www.2creatives.com/assets/centos65-x86_64-locale-test.box

@javornikolov
Copy link
Contributor Author

That last one link says: "Forbidden You don't have permission to access /assets/ on this server."

@casr
Copy link
Member

casr commented Jan 14, 2014

Check again?

@javornikolov
Copy link
Contributor Author

It's OK now.

@casr
Copy link
Member

casr commented Jan 14, 2014

Great!

@javornikolov
Copy link
Contributor Author

Just tested it. Seems working for me at first glimpse 👍 I'm testing some other things now.

@casr
Copy link
Member

casr commented Jan 14, 2014

Well I think my plan is to leave it until the weekend and do a release then if everything is working okay. This was the last thing I was hoping to tie up before that would happen.

@javornikolov
Copy link
Contributor Author

OK. I tested what I had in mind - for me it's working fine.

@casr
Copy link
Member

casr commented Jan 14, 2014

Awesome. Thanks for testing this out!

casr added a commit that referenced this issue Jan 14, 2014
LC_TIME is actually still useful for local time zone information.
GH-7
@fyddaben
Copy link

@javornikolov .Thanks very much .It working for me on my centos images

@smoulin75
Copy link

yum reinstall glibc-common
did the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants