gnome-language-selector crashed with DBusException in call_blocking(): org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid locale name

Bug #930785 reported by Ivo
46
This bug affects 7 people
Affects Status Importance Assigned to Milestone
accountsservice (Ubuntu)
Fix Released
Undecided
Gunnar Hjalmarsson
language-selector (Ubuntu)
Fix Released
Undecided
Gunnar Hjalmarsson

Bug Description

In the Language Support->Reginal Formats->Display numbers...for:-> I changed the language to Bulgarian.

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: language-selector-gnome 0.69
ProcVersionSignature: Ubuntu 3.2.0-15.24-generic 3.2.5
Uname: Linux 3.2.0-15-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Sun Feb 12 00:36:53 2012
ExecutablePath: /usr/bin/gnome-language-selector
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120201.1)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/gnome-language-selector
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.UTF-8
PythonArgs: ['/usr/bin/gnome-language-selector']
SourcePackage: language-selector
Title: gnome-language-selector crashed with DBusException in call_blocking(): org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid locale name
UpgradeStatus: Upgraded to precise on 2012-02-11 (0 days ago)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Ivo (dexbg) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in language-selector (Ubuntu):
status: New → Confirmed
Martin Pitt (pitti)
visibility: private → public
Martin Pitt (pitti)
Changed in language-selector (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2012-02-13 06:32, Martin Pitt wrote on bug 931060:
> Gunnar Hjalmarsson [2012-02-13 3:01 -0000]:
>> It's the user_locale_validate() function in
>> accountsservice/src/user.c that caused this crash. Is there a simple
>> way to make setlocale() instantly aware of newly generated locales?
>> If not I guess that playing with 'locale -a' in
>> user_locale_validate() would be safer than calling setlocale().
>
> I don't know off-hand myself. My guess is that libc reads them at
> program startup, so somehow you'd need to convince it to re-read it.
>
> But that locale -a workaround wouldn't help language-selector, as you
> still couldn't actually set the locale for language-selector itself or
> the session, you need to relogin in any case.

Actually I think it would help. The moment that currently fails is accountsservice's writing to its keyfile and ~/.pam_environment. So now, when you just have installed a new language, and wants to use a locale of that language for regional formats, you first need to log out/login to be able to accomplish the writing, and then log out/login again to make the new setting part of the actual environment.

Changed in language-selector (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

I checked the glibc source code, and it's not currently possible to reload locale-archive from a running program. So we do need to call out to locale -a.

affects: language-selector (Ubuntu) → accountsservice (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

The proposed change in accountsservice should fix this bug.

However, the example box on the "Regional formats" tab in language-selector depends on locale.setlocale() in Python, and neither that function has access to just generated locales, so the box shows an error message (se attachment). OTOH, the locale is set properly, and the program does not crash. Also, if you close language-selector and re-open it, the example box is filled as expected.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

With the proposed change to language-selector, the error message on the screenshot would instead read:

  [ Failed to apply the 'fr_FR.UTF-8' format
  choice. The examples may show up if you
  close and re-open Language Support. ]

Changed in language-selector (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: New → In Progress
Martin Pitt (pitti)
Changed in language-selector (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package accountsservice - 0.6.15-2ubuntu8

---------------
accountsservice (0.6.15-2ubuntu8) precise; urgency=low

  * debian/patches/0010-set-language.patch:
    - Call for setlocale() in the user_locale_validate() function in
      src/user.c replaced with 'locale -a' to allow a newly generated
      locale to be instantly used for regional formats (LP: #930785).
 -- Gunnar Hjalmarsson <email address hidden> Thu, 16 Feb 2012 14:43:00 +0100

Changed in accountsservice (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package language-selector - 0.71

---------------
language-selector (0.71) precise; urgency=low

  [ Gunnar Hjalmarsson ]
  * LanguageSelector/gtk/GtkLanguageSelector.py:
    Modified wording of the error message shown if the example box
    fails to apply the current locale (LP: #930785).

  [ Martin Pitt ]
  * data/pkg_depends: Drop myspell-ru, we have hunspell-ru now.
  * data/pkg_depends: Add cmap-adobe-* packages for ghostscript. (LP: #496012)
 -- Martin Pitt <email address hidden> Fri, 02 Mar 2012 06:54:37 +0100

Changed in language-selector (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Gabriel Marques (gabriel-agm+lauchpad) wrote :

My Ubuntu12.04 installation has language-selector package v 0.79 and still crashes with the message:
   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
     message, timeout)
 DBusException: org.freedesktop.Accounts.Error.Failed: running '/usr/share/language-tools/save-to-pam-env' failed: no output

Typing latin characters in the terminal yelds question marks, na typing 'locale' outputs:
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

My ~/.pam_environment has:
LANGUAGE=en
LANG=en_US.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_MONETARY=pt_BR.UTF-8
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8

Any other info I can check on my system to help?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Gabriel,

Your problem seems not to be related to this bug report, which has been closed for over a year.

Can you please file a new bug about your problem. Do so by opening a terminal window and type:

  ubuntu-bug language-selector

In addition to the info you already posted, please also let us know what the command

  locale -a

outputs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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