Univention Bugzilla – Bug 36658
UMC-server crash: corrupt .mo file
Last modified: 2015-02-04 15:55:59 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
Maybe the internal process for registering apps in UMC has not been completely finished upon a reload of the module list?
(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).
Created attachment 6525 [details] patch Attached a patch which catches the error and continues untranslated.
We should also backport this to UCS 3.2
Adding a IOError in the exception catching would also fix Bug #35066.
seen this bug also on a UCS DC Master, the DC Backup in the same domain hasn't this error.
Reported again: Ticket #2015012921000029
*** Bug 35066 has been marked as a duplicate of this bug. ***
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
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 ...
<http://errata.univention.de/ucs/4.0/73.html>