Bug 53424 - ucr commit fails in Module: symlink_portal
ucr commit fails in Module: symlink_portal
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Portal
UCS 5.0
Other Linux
: P5 normal with 3 votes (vote)
: UCS 5.0-0-errata
Assigned To: Philipp Hahn
Julia Bremer
:
Depends on: 30127
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-08 17:26 CEST by c.univention
Modified: 2021-10-06 16:48 CEST (History)
8 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?: 5: Will affect all installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.286
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): API change, Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description c.univention 2021-06-08 17:26:35 CEST
On a freshly ugraded UCS (from 4.4-8 to 5.0) :

running:

univention-portal add-default --update
ucr commit

ends with:

Module: symlink_portal
Traceback (most recent call last):
  File "/usr/sbin/ucr", 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 307, in handler_commit
    handlers.commit(ucr, args)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1131, in commit
    self.call_handler(ucr, handler)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1150, in call_handler
    handler((ucr, values))
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 635, in __call__
    run_module(self.module, 'generate', ucr, changed)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 222, in run_module
    arg2meth[arg](module)(ucr, changes)
  File "/etc/univention/templates/modules/symlink_portal.py", line 41, in handler
    old, new = changes['portal/paths']
ValueError: too many values to unpack (expected 2)

ucr get portal/paths
/univention/portal/, /univention/umc/

Portal inly shows Univention Blog once logged in as domain admin.
Comment 1 synedra IT 2021-07-20 09:16:07 CEST
Can confirm, happens to us too.
Comment 2 Moritz Bunkus 2021-08-06 14:42:27 CEST
Same here, both on a system updated from 4.4-8 to 5.0 and on a freshly installed 5.0 as well. The latter is on errata 65.
Comment 3 Olaf Peter 2021-10-03 11:18:54 CEST
Same on freshly installed 5.0 servers (5.0-0-Errata109)
Comment 4 Philipp Hahn univentionstaff 2021-10-03 22:12:26 CEST
This can be triggered by just calling
> ucr commit

For UCS 5.0 3c8d090c10d16acbb8fcdf3ebc52f8b1f8b453f7 changed the API for handler() to be more consistent (Bug #30127), but in case of "ucr commit" `handler()` is still called with `Dict[str, str]` instead of `Dict[str, Tuple[str, str]]`. This is the real bug which needs to be fixed: Always call `handler(UCR, Dict[str, Tuple[str, str]])`

The documentation on <http://docs.software-univention.de/developer-reference-5.0.html#ucr:module> still does not match the implementation.

[5.0-0] 8e196da0f4 test[ucr] Delay Autoload.AWAYS test
 base/univention-config-registry/tests/test_ucr.py | 3 +++
 1 file changed, 3 insertions(+)
[5.0-0] 4d4debce12 refactor[ucr] Rewrite as list comprehension
 base/univention-config-registry/python/univention/config_registry/handler.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
[5.0-0] dd11f6480d fix[ucr] Always call handler() with 2-tuple dict
 base/univention-config-registry/python/univention/config_registry/handler.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
[5.0-0] 3493450e2e refactor[ucr]: Use Python module function name
 base/univention-config-registry/python/univention/config_registry/handler.py | 13 ++++---------
 base/univention-config-registry/tests/test_handler.py                        | 14 +++++++-------
 2 files changed, 11 insertions(+), 16 deletions(-)
[5.0-0] 71a0644f00 style[ucr] Separate lookup from call
 base/univention-config-registry/python/univention/config_registry/handler.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
[5.0-0] 1443d4bbbe fix[ucr] Always call handler() with 2-tuple dict
 base/univention-config-registry/debian/changelog   |  6 ++++++
 doc/errata/staging/univention-config-registry.yaml | 12 ++++++++++++
 2 files changed, 18 insertions(+)

Package: univention-config-registry
Version: 15.0.7-10A~5.0.0.202110032201
Branch: ucs_5.0-0
Scope: errata5.0-0

[5.0-0] fcdbadb33a Bug #53424: univention-config-registry 15.0.7-10A~5.0.0.202110032201
 doc/errata/staging/univention-config-registry.yaml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

QA: git diff 5e46c1cc9b..fcdbadb33a
<https://git.knut.univention.de/univention/ucs/-/compare/5e46c1cc...fcdbadb33a?from_project_id=3>
Comment 5 Julia Bremer univentionstaff 2021-10-06 13:28:14 CEST
Problem not reproducible: OK
Code review: OK
Cleanups/refactorings: OK
Automated tests:OK

Verified