Bug 33916 - UMC server fails to start if locale settings are en_NG
UMC server fails to start if locale settings are en_NG
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCS Installer
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-0-errata
Assigned To: Erik Damrose
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-13 13:51 CET by Daniel Orrego
Modified: 2014-01-29 11:18 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Orrego univentionstaff 2014-01-13 13:51:29 CET
univention-management-console-server fails to start if locale settings are set to en_NG (Nigeria) with the following traceback:

13.01.14 13:16:57.973  MAIN        ( PROCESS ) : Starting UMC server ...
13.01.14 13:16:57.991  MAIN        ( ERROR   ) : Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 209, in <module>
    umc_daemon.do_action()
  File "/usr/lib/pymodules/python2.6/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/sbin/univention-management-console-server", line 142, in _restart
    self._start()
  File "/usr/lib/pymodules/python2.6/daemon/runner.py", line 131, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 185, in run
    from univention.management.console.protocol.server import Server
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/__init__.py", line 186, in <modul
e>
    from message import *
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/message.py", line 55, in <module>
    _ = Translation( 'univention.management.console' ).translate
  File "/usr/lib/pymodules/python2.6/univention/lib/i18n.py", line 93, in __init__
    self.set_language()
  File "/usr/lib/pymodules/python2.6/univention/lib/i18n.py", line 135, in set_language
    lang = getlocale( LC_MESSAGES )
  File "/usr/lib/python2.6/locale.py", line 497, in getlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: en_NG
Comment 1 Stefan Gohmann univentionstaff 2014-01-13 14:30:50 CET
Dirk, can you provide a patch?
Comment 2 Dirk Wiesenthal univentionstaff 2014-01-13 16:55:41 CET
(In reply to Stefan Gohmann from comment #1)
> Dirk, can you provide a patch?

Quick and dirty fix:
root@master:~# ucr set locale="en_NG.UTF-8:UTF-8" locale/default="en_NG.UTF-8:UTF-8"

Seems that the ".UTF-8" is missing when choosing Nigeria from the installer (Text installer, UMC system setup works fine). Will be investigated.
Comment 3 Dirk Wiesenthal univentionstaff 2014-01-13 17:36:11 CET
The following locales do not contain a ".UTF-8" in /usr/share/i18n/SUPPORTED. This file is used by univention-installer and, apparently, .UTF-8 is required for UMC-Server to work.

(Script to determine this list may be wrong, I hacked it into the interpreter)
aa_ER
aa_ER@saaho
aa_ET
am_ET
ar_IN
ber_DZ
ber_MA
bn_BD
bn_IN
bo_CN
bo_IN
byn_ER
crh_UA
csb_PL
dv_MV
dz_BT
en_AG
en_IN
en_NG
eo
fa_IR
fil_PH
fur_IT
fy_NL
fy_DE
gez_ER
gez_ER@abegede
gez_ET
gez_ET@abegede
gu_IN
ha_NG
hi_IN
hne_IN
ht_HT
hy_AM
hy_AM.ARMSCII-8
ia
ig_NG
ik_CA
iu_CA
km_KH
kn_IN
ks_IN
ks_IN@devanagari
ky_KG
li_BE
li_NL
lo_LA
mai_IN
ml_IN
mn_MN
mr_IN
my_MM
nan_TW@latin
nds_DE
nds_NL
ne_NP
nl_AW
nr_ZA
nso_ZA
om_ET
or_IN
pa_IN
pa_PK
pap_AN
ps_AF
rw_RW
sa_IN
sc_IT
sd_IN
sd_IN@devanagari
se_NO
shs_CA
si_LK
sid_ET
so_ET
sr_ME
sr_RS
sr_RS@latin
ss_ZA
ta_IN
te_IN
ti_ER
ti_ET
tig_ER
tk_TM
tn_ZA
ts_ZA
ug_CN
ur_PK
ve_ZA
vi_VN
vi_VN.TCVN
wo_SN
yo_NG

Best fix seems to be in
univention-installer/installer/modules/20_timezone.py
  get_locale_from_language
given that those locales listed above work fine with UTF-8
Comment 4 Erik Damrose univentionstaff 2014-01-24 10:34:29 CET
The fix uses the same method that the appliance setup applies: Check if the locale contains UTF-8; if not, append it to the locale setting. Works fine with the tested language/country combinations.

DVDs for ucs 3.2-1 have been created to test the changes.

r47214 univention-installer 9.0.30-5.1104.201401171439
r47419 2014-01-24-univention-installer.yaml
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2014-01-28 17:32:40 CET
(In reply to Erik Damrose from comment #4)
> The fix uses the same method that the appliance setup applies: Check if the
> locale contains UTF-8; if not, append it to the locale setting. Works fine
> with the tested language/country combinations.
> 
> DVDs for ucs 3.2-1 have been created to test the changes.
> 
> r47214 univention-installer 9.0.30-5.1104.201401171439
> r47419 2014-01-24-univention-installer.yaml

# [Time zone]
timezone='Europe/Berlin'
locale_default='C.UTF-8:UTF-8'
locales='C.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
# [Time zone]
timezone='Africa/Lagos'
locale_default='en_NG.UTF-8:UTF-8'
locales='en_NG.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
# [Time zone]
timezone='America/New_York'
locale_default='en_US.UTF-8:UTF-8'
locales='en_US.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
# [Time zone]
timezone='Antarctica/McMurdo'
locale_default='eo.UTF-8:UTF-8'
locales='eo.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
# [Time zone]
timezone='Europe/Kaliningrad'
locale_default='ru_RU.UTF-8:UTF-8'
locales='ru_RU.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
# [Time zone]
timezone='Europe/Berlin'
locale_default='de_DE.UTF-8:UTF-8'
locales='de_DE.UTF-8:UTF-8'
LANG=de_DE.UTF-8
LANGUAGE=
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2014-01-28 17:58:05 CET
Last comment was incomplete:

(In reply to Erik Damrose from comment #4)
> The fix uses the same method that the appliance setup applies: Check if the
> locale contains UTF-8; if not, append it to the locale setting. Works fine
> with the tested language/country combinations.

OK: code change
NOTE: code may fail if self.cmdline.get("DEFAULT_LOCALE", "en_US.UTF-8")
      contains broken fallback locale like "en_US:UTF-8". In this case the
      resulting fallback locale would be "en_US:UTF-8.UTF-8:UTF-8".
      But this should be no problem here.
OK: package version change
 
> DVDs for ucs 3.2-1 have been created to test the changes.

OK: installation tests
OK: login tests to UMC
OK: resulting locales

Profile:
  timezone='Europe/Berlin'
  locale_default='C.UTF-8:UTF-8'
  locales='C.UTF-8:UTF-8'
Resulting Locale:
  LANG=C.UTF-8

Profile:
  timezone='Africa/Lagos'
  locale_default='en_NG.UTF-8:UTF-8'
  locales='en_NG.UTF-8:UTF-8'
Resulting Locale:
  LANG=en_NG.UTF-8

Profile:
  timezone='America/New_York'
  locale_default='en_US.UTF-8:UTF-8'
  locales='en_US.UTF-8:UTF-8'
Resulting Locale:
  LANG=en_US.UTF-8

Profile:
  timezone='Antarctica/McMurdo'
  locale_default='eo.UTF-8:UTF-8'
  locales='eo.UTF-8:UTF-8'
Resulting Locale:
  LANG=eo.UTF-8

Profile:
  timezone='Europe/Kaliningrad'
  locale_default='ru_RU.UTF-8:UTF-8'
  locales='ru_RU.UTF-8:UTF-8'
Resulting Locale:
  LANG=ru_RU.UTF-8

Profile:
  timezone='Europe/Berlin'
  locale_default='de_DE.UTF-8:UTF-8'
  locales='de_DE.UTF-8:UTF-8'
Resulting Locale:
  LANG=de_DE.UTF-8

> r47214 univention-installer 9.0.30-5.1104.201401171439
> r47419 2014-01-24-univention-installer.yaml

OK: YAML
Comment 7 Moritz Muehlenhoff univentionstaff 2014-01-29 11:18:20 CET
http://errata.univention.de/ucs/3.2/34.html