Univention Bugzilla – Bug 28070
traceback when opening system setup modules
Last modified: 2017-07-26 14:39:04 CEST
Ein Traceback erscheint sofort beim Öffnen des Moduls "Basiseinstellungen": Die Ausf�hrung des Kommandos setup/load ist fehlgeschlagen: Traceback (most recent call last): File '/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py', line 195, in execute func( request ) File '/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/__init__.py', line 109, in load self.finished(request.id, values) File '/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py', line 253, in finished self.result( res ) File '/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py', line 260, in result self.signal_emit( 'success', response ) File '/usr/lib/pymodules/python2.6/notifier/signals.py', line 75, in signal_emit self.__signals[ signal ].emit( *args ) File '/usr/lib/pymodules/python2.6/notifier/signals.py', line 41, in emit cb( *args ) File '/usr/lib/pymodules/python2.6/notifier/__init__.py', line 104, in __call__ return self._function( *tmp, **self._kwargs ) File '/usr/lib/pymodules/python2.6/univention/management/console/protocol/modserver.py', line 109, in _reply self.response( msg ) File '/usr/lib/pymodules/python2.6/univention/management/console/protocol/modserver.py', line 292, in response data = str( msg ) File '/usr/lib/pymodules/python2.6/univention/management/console/protocol/message.py', line 312, in __str__ return Message._formattedMessage(self._id, self._type, self.mimetype, self.command, body, self.arguments) File '/usr/lib/pymodules/python2.6/univention/management/console/protocol/message.py', line 116, in _formattedMessage data = json.dumps( body ) File '/usr/lib/pymodules/python2.6/simplejson/__init__.py', line 261, in dumps return _default_encoder.encode(obj) File '/usr/lib/pymodules/python2.6/simplejson/encoder.py', line 214, in encode chunks = self.iterencode(o, _one_shot=True) File '/usr/lib/pymodules/python2.6/simplejson/encoder.py', line 282, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 9: invalid start byte Das System ist relativ alt und hat noch keine UTF-8-Locales: root@master:~# locale LANG=de_DE@euro LANGUAGE= LC_CTYPE="de_DE@euro" LC_NUMERIC="de_DE@euro" LC_TIME="de_DE@euro" LC_COLLATE="de_DE@euro" LC_MONETARY="de_DE@euro" LC_MESSAGES="de_DE@euro" LC_PAPER="de_DE@euro" LC_NAME="de_DE@euro" LC_ADDRESS="de_DE@euro" LC_TELEPHONE="de_DE@euro" LC_MEASUREMENT="de_DE@euro" LC_IDENTIFICATION="de_DE@euro" LC_ALL= root@master:~# ucr search --brief locale locale/default: de_DE@euro:ISO-8859-15 locale/keymap: <empty> locale: de_DE.UTF-8:UTF-8 de_DE@euro:ISO-8859-15 root@master:~#
Tritt denn die Fehlermeldung auf, wenn die Locale auf UTF8 gesetzt wird, also: ucr set locale/default=de_DE.UTF-8:UTF-8 locale=de_DE.UTF-8:UTF-8
The traceback has nothing to do with the set locale. It occurs when non-UTF8 values as python byte(str) (not unicode) objects are contained in the response dict. Some of the setup/load values were probably ISO8859-1.
I could simply reproduce this by doing this: >>> fd = open('/etc/timezone', 'w') >>> fd.write(u'Europe/börlin'.encode('latin1')) >>> fd.flush() The timezone looks like the only possibly failing thing in load_values(). (UCR values cannot be latin1 afaik).
Created attachment 6028 [details] patch
Also reported via traceback feedback: Version: 4.0-4 errata402 (Walle) Traceback(591c6c5cd74409e5d867805deef3de43): Die Ausführung des Kommandos setup/load network ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 282, in execute function(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response self.finished(request.id, result[0]) File "%PY2.7%/univention/management/console/base.py", line 383, in finished self.result(res) File "%PY2.7%/univention/management/console/base.py", line 387, in result self.signal_emit('success', response) File "%PY2.7%/notifier/signals.py", line 75, in signal_emit self.__signals[ signal ].emit( *args ) File "%PY2.7%/notifier/signals.py", line 41, in emit cb( *args ) File "%PY2.7%/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "%PY2.7%/univention/management/console/protocol/modserver.py", line 118, in _reply self.response(msg) File "%PY2.7%/univention/management/console/protocol/modserver.py", line 341, in response self.__queue += str(msg) File "%PY2.7%/univention/management/console/protocol/message.py", line 337, in __str__ return Message._formattedMessage(self._id, self._type, self.mimetype, self.command, body, self.arguments) File "%PY2.7%/univention/management/console/protocol/message.py", line 130, in _formattedMessage data = json.dumps(body) File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 321, in dumps return _default_encoder.encode(obj) File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 237, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 311, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 6: invalid start byte
(In reply to Florian Best from comment #4) > Created attachment 6028 [details] > patch Applied patch: r 80867 univention-system-setup (10.0.10-21) * Bug #28070: Applied patch from Florian Best - Fix error caused by non UTF-8 values in load_values YAML: r 80868
r 80890 univention-system-setup (10.0.10-23) * Bug #28070: Applied additional patch from Florian Best
r 80898 univention-system-setup (10.0.10-24) * Bug #28070: Applied additional patch from Florian Best YAML: r 80904
OK: this is robust now OK: invalid encoding in App README OK: invalid encoding in /etc/timezone OK: invalid encoding in UCR variable OK: unset UCR variable OK: YAML (adjusted in r80889)
<http://errata.software-univention.de/ucs/4.2/109.html>