Bug 55512 - ucr not working after update to UCS 5.0 - UnicodeDecodeError
ucr not working after update to UCS 5.0 - UnicodeDecodeError
Status: NEW
Product: UCS
Classification: Unclassified
Component: UCR
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on: 18006
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-21 10:29 CET by Arvid Requate
Modified: 2022-12-22 11:58 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022122021000387
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2022-12-21 10:29:54 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
Comment 1 Philipp Hahn univentionstaff 2022-12-21 17:10:38 CET
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.
Comment 2 Christina Scheinig univentionstaff 2022-12-22 11:58:32 CET
In the customer environment the ucr was empty
root@ucs:/var/log# ucr search ucr/encoding/strict
ucr/encoding/strict: <empty>