Univention Bugzilla – Bug 41539
log file not viewable in software update module
Last modified: 2017-04-04 18:29:18 CEST
If the log contains non-utf8-able characters the log view crashes: Version: 4.1-2 errata197 (Vahr) Remark: I just wanted to see the join-logs. :( On the server the logfile is available. Gr! Traceback(591c6c5cd74409e5d867805deef3de43): Execution of command 'join/logview' has failed: Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 283, in execute function(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 320, in _response self.finished(request.id, result[0]) File "%PY2.7%/univention/management/console/base.py", line 401, in finished self.result(res) File "%PY2.7%/univention/management/console/base.py", line 405, 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 350, 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 0xb0 in position 88365: invalid start byte
Reported again, 4.1-2 errata191 (Vahr) Remark: I just installed the latest updates, so version is 4.1-2
diff --git a/base/univention-updater/umc/python/updater/__init__.py b/base/univention-updater/umc/python/updater/__init__.py index 05f1236..d252a8b 100644 --- a/base/univention-updater/umc/python/updater/__init__.py +++ b/base/univention-updater/umc/python/updater/__init__.py @@ -488,7 +488,7 @@ def _logview(self, fname, count): if (count < 0): count += 1 else: - lines.append(line.rstrip()) + lines.append(line.rstrip().decode('utf-8', 'replace')) if (count > 0) and (len(lines) > count): lines.pop(0) except (IOError, OSError):
Same traceback has been reported at Bug 28070.
Reproduce via: printf '\xe4' >> /var/log/univention/updater.log
Patch applied, changelog added. univention-updater (12.0.1-1): r72900 | Bug #41539: non-UTF-8 characters don't cause a crash when viewing the logfile anymore
Same problem in the join logview: univention-join (9.0.2-1): r76040 | Bug #41539: fix decoding error if logfile contains non-utf-8 character
Fixed bug in univention-updater (4.2): Verified Fixed bug in univention-join (4.2): Verified Changelog: Ok
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".