Bug 54849 - KeyError: 'producer' when creating printer
KeyError: 'producer' when creating printer
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Florian Best
Julia Bremer
:
Depends on: 53843
Blocks: 55887
  Show dependency treegraph
 
Reported: 2022-06-10 09:21 CEST by Florian Best
Modified: 2023-03-17 10:17 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022071921000523, 2022062221000064, 2022061521000407, 2022061421000311, 2022061321000232, 2022061021000274, 2022060921000491, 2022060921000401, 2022061021000185, 2022061021000274, 2022060921000491
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 Florian Best univentionstaff 2022-06-10 09:21:39 CEST
Bug #53843 introduced a regression:

Version: 5.0-1 errata336

Remark: Fehlermeldung kommt beim Hinzufügen einer Druckerfreigabe.

Error:
Interner Server-Fehler in "udm/syntax/choices (shares/print)".
Request: udm/syntax/choices (shares/print)

Traceback (most recent call last):
  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 99, in _decorated
    return method(*args, **kwargs)
  File "%PY3%/univention/management/console/ldap.py", line 152, in _decorated
    result = func(*args, **kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 1002, in _thread
    return read_syntax_choices(syntax, options, ldap_connection=ldap_connection, ldap_position=ldap_position)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 1359, in read_syntax_choices
    choices = syn.get_choices(ldap_connection, options)
  File "%PY3%/univention/admin/syntax.py", line 1034, in get_choices
    obj = module.object(None, lo, None, options[cls.depends])
KeyError: 'producer'

+++ This bug was initially created as a clone of Bug #53843 +++
Comment 1 Florian Best univentionstaff 2022-06-10 09:25:26 CEST
Reproducer:
curl 'https://Administrator:univention@demo.univention.de/univention/command/udm/syntax/choices' -H 'Accept: application/json; q=1.0' -H 'Content-Type: application/json'   --data-raw '{"options":{"producer":"cn=Alps,cn=cups,cn=univention,l=school,l=dev","syntax":"PrinterDriverList","$depends$":"producer"},"flavor":"shares/print"}'
Comment 2 Florian Best univentionstaff 2022-06-10 11:28:51 CEST
dependencies used to be part of options directly, during implementing they were moved into options['dependencies'].

univention-directory-manager-modules.yaml
211defccfca0 | Bug #54849: fix error resolving dependencies of UDM_Attributes based syntax classes

univention-directory-manager-modules (15.0.11-52)
211defccfca0 | Bug #54849: fix error resolving dependencies of UDM_Attributes based syntax classes
Comment 3 Julia Bremer univentionstaff 2022-06-10 12:17:31 CEST
OK: Reproduced
OK: Can add printers after upgrading to the fix
OK: Yaml
Verified
Comment 5 Maximilian Janßen univentionstaff 2022-07-06 15:59:40 CEST
Version: 5.0-1 errata339

Error: 
Interner Server-Fehler in "udm/syntax/choices (shares/print)".
Request: udm/syntax/choices (shares/print)

Traceback (most recent call last):
  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 99, in _decorated
    return method(*args, **kwargs)
  File "%PY3%/univention/management/console/ldap.py", line 152, in _decorated
    result = func(*args, **kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 1002, in _thread
    return read_syntax_choices(syntax, options, ldap_connection=ldap_connection, ldap_position=ldap_position)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 1359, in read_syntax_choices
    choices = syn.get_choices(ldap_connection, options)
  File "%PY3%/univention/admin/syntax.py", line 1034, in get_choices
    obj = module.object(None, lo, None, options.get('dependencies', {})[cls.depends])
KeyError: 'producer'

Role: domaincontroller_master