Univention Bugzilla – Bug 55512
ucr not working after update to UCS 5.0 - UnicodeDecodeError
Last modified: 2022-12-22 11:58:32 CET
============================================================== Traceback (most recent call last): File "/usr/sbin/univention-config-registry", line 67, in <module> ub.main(convertToUtf8(sys.argv[1:])) File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 824, in main result = handler_func(args, cmd_opts) File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 142, in handler_set with ucr: File "/usr/lib/python3/dist-packages/univention/config_registry/backend.py", line 470, in __enter__ self.load() File "/usr/lib/python3/dist-packages/univention/config_registry/backend.py", line 241, in load reg.load() File "/usr/lib/python3/dist-packages/univention/config_registry/backend.py", line 586, in load for line in reg_file: File "/usr/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 2807: invalid continuation byte ============================================================== This was caused by this setting in base.conf: samba/password/forbiddenchars='"äöü ÄÖܧß' ucr started working again after removing the key from base.conf. Then I have set the value again on the command line and ucr continued to work. root@server:~# file /etc/univention/base.conf.orig /etc/univention/base.conf.orig: Non-ISO extended-ASCII text, with very long lines root@server:~# file /etc/univention/base.conf /etc/univention/base.conf: UTF-8 Unicode text, with very long lines Installed univention-config-registry version was 14.0.0-18A~4.4.0.202007200731
Please check UCRV `ucr/encoding/strict?true`: It it is `False` someone has deliberately disabled that sanity check some very long time ago and/or the value was set before "strict mode" was added with UCS 3.0-0 in 2011. Probably WONTFIX as there are only a very few old installations left which might be affected. Adding a pretty error message won't help.
In the customer environment the ucr was empty root@ucs:/var/log# ucr search ucr/encoding/strict ucr/encoding/strict: <empty>