Bug 36658 - UMC-server crash: corrupt .mo file
UMC-server crash: corrupt .mo file
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-0-errata
Assigned To: Florian Best
Alexander Kramer
:
: 35066 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-13 16:52 CET by Andreas Peichert
Modified: 2015-02-04 15:55 CET (History)
6 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:
Ticket number:
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (3.00 KB, patch)
2014-12-11 11:08 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Peichert univentionstaff 2014-11-13 16:52:52 CET
After an update the UMC-server crashed on login (modules/list call) due to an corrupt .mo file. See Bug #36657.

13.11.14 16:47:45.345  LOCALE      ( INFO    ) : Found translation file /usr/share/univention-management-console/i18n/de/apps.mo
13.11.14 16:47:45.347  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.7/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 192, in run
    notifier.loop()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 284, in loop
    step()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 271, in step
    not __sockets[ cond ][ fd ]( sock_obj ):
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 168, in _receive
    self._handle(state, msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 286, in _handle
    state.processor.request(msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 287, in request
    self.handle_request_get(msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 439, in handle_request_get
    'name': self.i18n._(flavor.name, translationId),
  File "/usr/lib/pymodules/python2.7/univention/management/console/locales.py", line 180, in _
    self[domain] = I18N(self.locale, domain)
  File "/usr/lib/pymodules/python2.7/univention/management/console/locales.py", line 78, in __init__
    self.load(locale, domain)
  File "/usr/lib/pymodules/python2.7/univention/management/console/locales.py", line 108, in load
    self.mofile = polib.mofile(filename)
  File "/usr/lib/python2.7/dist-packages/polib.py", line 141, in mofile
    return _pofile_or_mofile(mofile, 'mofile', **kwargs)
  File "/usr/lib/python2.7/dist-packages/polib.py", line 74, in _pofile_or_mofile
    instance = parser.parse()
  File "/usr/lib/python2.7/dist-packages/polib.py", line 1536, in parse
    magic_number = self._readbinary('<I', 4)
  File "/usr/lib/python2.7/dist-packages/polib.py", line 1621, in _readbinary
    tup = struct.unpack(fmt, bytes)
error: unpack requires a string argument of length 4
Comment 1 Alexander Kläser univentionstaff 2014-11-14 18:21:24 CET
Maybe the internal process for registering apps in UMC has not been completely finished upon a reload of the module list?
Comment 2 Janis Meybohm univentionstaff 2014-12-11 09:01:25 CET
(In reply to Andreas Peichert from comment #0)
> After an update the UMC-server crashed on login (modules/list call) due to
> an corrupt .mo file. See Bug #36657.

Maybe this could be simple avoided by skipping corrupt .mo files. UMC could show an error message to the user ("Translation file /usr/share/univention-management-console/i18n/de/apps.mo could not be loaded. You may encounter untranslated text in this session") but it would still work (not failing silently).
Comment 3 Florian Best univentionstaff 2014-12-11 11:08:15 CET
Created attachment 6525 [details]
patch

Attached a patch which catches the error and continues untranslated.
Comment 4 Janis Meybohm univentionstaff 2014-12-15 11:02:44 CET
We should also backport this to UCS 3.2
Comment 5 Florian Best univentionstaff 2014-12-16 17:09:35 CET
Adding a IOError in the exception catching would also fix Bug #35066.
Comment 6 Ingo Steuwer univentionstaff 2015-01-09 21:42:11 CET
seen this bug also on a UCS DC Master, the DC Backup in the same domain hasn't this error.
Comment 7 Stefan Gohmann univentionstaff 2015-02-02 06:50:45 CET
Reported again: Ticket #2015012921000029
Comment 8 Florian Best univentionstaff 2015-02-02 10:56:21 CET
*** Bug 35066 has been marked as a duplicate of this bug. ***
Comment 9 Florian Best univentionstaff 2015-02-02 11:00:06 CET
Don't crash the server anymore if .mo file is empty or corrupt

Fix: svn r57701
YAML: 2015-02-02-univention-management-console.yaml
Package: univention-management-console
Version: 7.1.63-12.853.201502021053
Comment 10 Alexander Kramer univentionstaff 2015-02-03 12:38:46 CET
OK - Don't crash the server anymore if .mo file is empty or corrupt (see below)
OK - debian/changelog
OK - yaml file

tail -F /var/log/univention/management-console-server.log
03.02.15 11:15:17.109  MAIN        ( ERROR   ) : Corrupted .mo file detected for translation domain 'appcenter': unpack requires a string argument of length 4
03.02.15 11:15:17.109  MAIN        ( ERROR   ) : Corrupted .mo file detected for translation domain 'appcenter': unpack requires a string argument of length 4
03.02.15 11:15:17.109  MAIN        ( ERROR   ) : Corrupted .mo file detected for translation domain 'appcenter': unpack requires a string argument of length 4
03.02.15 11:15:17.110  MAIN        ( ERROR   ) : Corrupted .mo file detected for translation domain 'appcenter': unpack requires a string argument of length 4
...
Comment 11 Janek Walkenhorst univentionstaff 2015-02-04 15:55:59 CET
<http://errata.univention.de/ucs/4.0/73.html>