Bug 28070 - traceback when opening system setup modules
traceback when opening system setup modules
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Basic settings
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Johannes Keiser
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-25 14:35 CEST by Sönke Schwardt-Krummrich
Modified: 2017-07-26 14:39 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, External feedback, Internationalization
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (531 bytes, patch)
2014-07-29 10:53 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2012-07-25 14:35:13 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:~#
Comment 1 Alexander Kläser univentionstaff 2012-07-25 15:15:56 CEST
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
Comment 2 Florian Best univentionstaff 2014-07-29 10:43:44 CEST
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.
Comment 3 Florian Best univentionstaff 2014-07-29 10:50:05 CEST
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).
Comment 4 Florian Best univentionstaff 2014-07-29 10:53:41 CEST
Created attachment 6028 [details]
patch
Comment 5 Florian Best univentionstaff 2016-08-30 12:50:24 CEST
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
Comment 6 Johannes Keiser univentionstaff 2017-07-05 14:28:35 CEST
(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
Comment 7 Johannes Keiser univentionstaff 2017-07-05 17:23:16 CEST
r 80890
univention-system-setup (10.0.10-23) 
* Bug #28070: Applied additional patch from Florian Best
Comment 8 Johannes Keiser univentionstaff 2017-07-06 11:30:42 CEST
r 80898
univention-system-setup (10.0.10-24) 
* Bug #28070: Applied additional patch from Florian Best
YAML: r 80904
Comment 9 Florian Best univentionstaff 2017-07-06 12:47:04 CEST
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)
Comment 10 Erik Damrose univentionstaff 2017-07-26 14:39:04 CEST
<http://errata.software-univention.de/ucs/4.2/109.html>