You are not logged in.

#1 2015-10-26 17:51:09

piedro
Member
Registered: 2013-04-11
Posts: 218

Only for one user: Locale not supported by C library

Hello!

With my own user account I get this error message when starting dropbox:

Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale

Which is strange because a new user account with the same regional settings does not have the same problem.

So I guess there are some leftovers from updating KDE, plasma or some other settings in my own (an old) user account.

As I cannot find any files related to that problem I ask here... also all the system wide locale settings are alright and do not produce any errors.

I'd rather avoid setting up my user account from scratch. I'd be glad if someone could help me out here...

thx, p.

Offline

#2 2015-10-26 19:45:25

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Only for one user: Locale not supported by C library

Examine the output of the following command:

locale
locale -a
env | grep -E 'LC|LANG'

From this you will see the offending locale. Available locales are displayed with locale -a; they must be uncommented in /etc/locale.gen and generated with locale-gen. If it is due to an incorrect locale, it must resides in ~/.profile, ~/.xprofile ~/.config/locale or something like that. Use grep to find the file if you can't locate it. Something like:

find -type f -exec grep --binary-files=without-match <offending locale> {} +

Very unlikely, the display manager could have set one of the locale variables incorrectly.

Last edited by olive (2015-10-26 19:49:35)

Offline

#3 2015-10-26 20:13:55

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

thx for your help here:

$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
de_DE.utf8
en_DK.utf8
en_GB.utf8
en_US.utf8

which is strange cause in locale.gen they are listed as
"de_DE.UTF-8", "en_DK.UTF-8"... and so forth...

$ 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=de
LC_CTYPE="de"
LC_NUMERIC="de"
LC_TIME="de"
LC_COLLATE="de"
LC_MONETARY="de"
LC_MESSAGES="de"
LC_PAPER="de"
LC_NAME="de"
LC_ADDRESS="de"
LC_TELEPHONE="de"
LC_MEASUREMENT="de"
LC_IDENTIFICATION="de"
LC_ALL=

When I type the same commands as another user I do not get the "cannot set...." lines. Though in kde systemsettings the same setup is used.

$ env | grep -E 'LC|LANG'
LANG=de
LANGUAGE=de

Doing this for an alternate user gives me:

$ env | grep -E 'LC|LANG'
LANG=de_DE.UTF-8
LANGUAGE=de

Which seems to be much more correct.

Do you know how to fix this?

thx, p

Last edited by piedro (2015-10-26 20:15:40)

Offline

#4 2015-10-26 20:33:17

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Only for one user: Locale not supported by C library

"de" is not a correct locale, "de_DE.UTF-8" is correct. How is the locale selected? Could it be the login manager choosing an incorrect locale? Do you find an offending file with:

find -type f -exec grep --binary-files=without-match "LANG=de" {} +

(or with the same command with LANGUAGE=de). You can usually set the locale explicitly in ~/.profile:

export LANG=de_DE.utf8
export LA?GUAGE=de_DE.utf8

But it would be better to find where this incorrect locale is set. What is the content of /etc/locale.conf?

Offline

#5 2015-10-26 20:45:42

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

In "/etc/locale.conf" there is only 1 line:

LANG=de_DE.UTF-8

"~/.config/locale.conf" doesn't exist... 

The find command does give me thousands of files... that doesn't seem to work...

Edit: typo

Last edited by piedro (2015-10-26 20:54:33)

Offline

#6 2015-10-26 20:54:12

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Only for one user: Locale not supported by C library

en_DE.UTF-8 is incorrect, if this is not a typo in your post, replace it with de_DE.UTF-8. You find thousands of files if you run this command inside your home directory?

find -type f -exec grep --binary-files=without-match "LANG=de" {} +

Offline

#7 2015-10-26 20:56:03

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

Sry, that was just a typo on my part while typing here, it is correctly set in "/etc/locale.conf"

:-/

Offline

#8 2015-10-26 21:12:43

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

There has to be a problem with the KDE language setup "Regional settings":

I added two enlish locales as fallback and now I get:

$ env | grep -E 'LC|LANG'
LANG=de_DE.UTF-8
LANGUAGE=de:en_GB:en_US

There is always only the "de" in the LANGUAGE setting...

I'll try setting it in /etc/locale.conf...
...

Offline

#9 2015-10-26 21:40:22

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

Well that doesn't help...


The fallback LANGUAGES starting with "de" instead of "de_DE" seem to be buggily set by KDE.
I'll write a bug report to KDE.

But still, I think this sheds some light to the problem I have:

Starting dropbox I now do not get the GTK warning anymore - so that's good...!

Still the dropbox client does not read UTF-8 file names and paths even if I type "LANG=$LANGUAGE" as suggested in the Wiki. Probably reads "de" as preferred option instead of "de_DE" as it should from the list of fallback languages? 

If I use "LANG=de_DE.UTF-8", then "dropbox" it works initially (as it should by default). But when started by a systemd user service dropbox just shuts down silently again.

My guess is that for the moment I have to force the "LANG=de_DE.UTF-8" setting to the start of of the systemd user service dropbox somehow as a workaround...

Do you know how to do that?

Last edited by piedro (2015-10-26 21:40:39)

Offline

#10 2015-10-26 21:43:46

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

Oh, and sry,

I can't get the "find" command to finish tonight, that's about 3TB of project files, it's searching forever, might do it overnight...

thx anyway, p.

Offline

#11 2015-10-27 07:45:22

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Only for one user: Locale not supported by C library

Be a little clever and search where a potential file is likely to be. Probably somewhere in ~/.config  or in some ~/.*  file. You can probably force the good locale with:

export LANG=de_DE.UTF-8
export LANGUAGE=$LANG
export LC_ALL=$LANG

in ~/.profile.

Last edited by olive (2015-10-27 07:45:39)

Offline

#12 2015-10-28 06:32:27

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

I do not understand the .profile file...

Shouldn't that export the variables for a shell?
Which shell is it for a systemd user service?

What is it for systemd to write into the .profile file?

thx, p.

Last edited by piedro (2015-10-28 07:12:48)

Offline

#13 2015-10-28 07:12:21

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Only for one user: Locale not supported by C library

The display manager, when you login graphically execute a shell script, typically named Xsession, the precise location of which depend of the display manager. The Xsession script sources ~/.profile and launch the session (among other things). So that this file can be used to initialize the environment. At least all display manager that I know proceeds this way.

You are true that it is normally a bash initialization file, used to initialize the session when you log in at the console. The display manager proceeds the way I have described above so that ~/.profile can be used as a universal initialization file wether you log in graphically or at the console.

Note that this has nothing to do with systemd but well with the display manager.

Last edited by olive (2015-10-28 07:25:57)

Offline

#14 2015-10-30 18:29:43

piedro
Member
Registered: 2013-04-11
Posts: 218

Re: Only for one user: Locale not supported by C library

Thanks for your explanation! 

But anyway I can get dropbox to start as user service now. Sadly, though it should, the icon doesn't show up. Doesn't matter if I use the method as described in the Arch Wiki to set the display for the service to show the icon or not.

That's why I think the language setting might be messed up for the service but probably that's just wrong. Most likely is the Arch wiki isn't up to the constant changes with KDE...

thx for helping, cheers, p.

Last edited by piedro (2015-10-30 18:30:44)

Offline

Board footer

Powered by FluxBB