Bug 54322 - The new listener API uses typing but univention-directory-listener doesn' t depend on it
The new listener API uses typing but univention-directory-listener doesn' t d...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Philipp Hahn
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-11 11:36 CET by Arvid Requate
Modified: 2022-03-02 16:12 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few 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.034
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2021121421000141
Bug group (optional):
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-01-11 11:36:29 CET
At Support Ticket#2021121421000141 the package univention-appcenter-docker had been uninstalled (Bug #54321) and this showed that the new listener API uses the python module typing without declaring a Debian package dependency to python-typing. That caused a number of tracebacks like these for each Listener module that used the new API, breaking the functionality of these modules:


10.01.22 14:20:19.847  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/ldap_server.py failed
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/ldap_server.py", line 36, in <module>
    from typing import Dict, List, Optional  # noqa F401
ImportError: No module named typing
10.01.22 14:20:19.847  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/ldap_server.py failed in module_import()
10.01.22 14:20:20.340  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/app_attributes.py failed
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/app_attributes.py", line 45, in <module>
    from univention.listener.handler import ListenerModuleHandler
  File "/usr/lib/python2.7/dist-packages/univention/listener/__init__.py", line 44, in <module>
    from univention.listener.api_adapter import ListenerModuleAdapter
  File "/usr/lib/python2.7/dist-packages/univention/listener/api_adapter.py", line 32, in <module>
    from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple  # noqa F401
ImportError: No module named typing
10.01.22 14:20:20.341  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/app_attributes.py failed in module_import()
10.01.22 14:20:21.010  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/portal_groups.py failed
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/portal_groups.py", line 38, in <module>
    from univention.listener import ListenerModuleHandler, ListenerModuleConfiguration
  File "/usr/lib/python2.7/dist-packages/univention/listener/__init__.py", line 44, in <module>
    from univention.listener.api_adapter import ListenerModuleAdapter
  File "/usr/lib/python2.7/dist-packages/univention/listener/api_adapter.py", line 32, in <module>
    from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple  # noqa F401
ImportError: No module named typing
10.01.22 14:20:21.011  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/portal_groups.py failed in module_import()
Comment 1 Philipp Hahn univentionstaff 2022-01-11 12:38:38 CET
UCS-5 is Python 3 which has "typing" by default: https://docs.python.org/3/library/typing.html
No extra dependency required.

Looks like you're still running the old UDL from 4.4 still based on Python2.7, but already have new UDL modules from 5.0 based on Python3 being installed and run.
Comment 2 Daniel Tröder univentionstaff 2022-01-12 08:24:48 CET
Also in UCS 5.0 "univention-lib" has a dependency on "python-typing" in python-univention-lib (Python 2 version). So it's safe to assume "python-typing" is always installed in UCS 5.0.
Comment 3 Philipp Hahn univentionstaff 2022-03-02 07:59:18 CET
According to the original ticket the customer is at 4.4-8.
There indeed /usr/lib/univention-directory-listener/system/ldap_server.py and /usr/lib/python2.7/dist-packages/univention/listener/api_adapter.py are already importing "from typing".
Therefore UDL should declare the dependency on python-typing to make it work in all cases, especially on upgrades before "univention-lib"s dependencies are installed.

[4.4-8] 9a4565c62d fix[UDL]: Add dependency on python-typing
 doc/errata/staging/univention-directory-listener.yaml     | 10 ++++++++++
 management/univention-directory-listener/debian/changelog |  6 ++++++
 management/univention-directory-listener/debian/control   |  1 +
 3 files changed, 17 insertions(+)

<https://git.knut.univention.de/univention/ucs/-/commit/9a4565c62d524b8e92520931d6cff6fa3f947df1>
Package: univention-directory-listener
Version: 13.0.3-6A~4.4.0.202203020748
Branch: ucs_4.4-0
Scope: errata4.4-8

<https://git.knut.univention.de/univention/ucs/-/commit/e0c881e331097b7726cbd20fda6a0aab06016a7b>
[4.4-8] e0c881e331 Bug #54322: univention-directory-listener 13.0.3-6A~4.4.0.202203020748
 doc/errata/staging/univention-directory-listener.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

QA:
debdiff mirror/ftp/4.4/maintained/component/4.4-8-errata/amd64/univention-directory-listener_13.0.3-5A~4.4.0.202111181516_amd64.deb apt/ucs_4.4-0-errata4.4-8/amd64/univention-directory-listener_13.0.3-6A~4.4.0.202203020748_amd64.deb
debdiff mirror/ftp/4.4/maintained/component/4.4-8-errata/i386/univention-directory-listener_13.0.3-5A~4.4.0.202111181516_i386.deb apt/ucs_4.4-0-errata4.4-8/i386/univention-directory-listener_13.0.3-6A~4.4.0.202203020748_i386.deb
> [The following lists of changes regard files as different if they have different names, permissions or owners.> Control files: lines which differ (wdiff format)
> ------------------------------------------------
> Depends: bash, {+python-typing,+} …
> Version: [-13.0.3-5A~4.4.0.202111181516-] {+13.0.3-6A~4.4.0.202203020748+}

OK: errata-announce  -V --only univention-directory-listener.yaml
Comment 4 Arvid Requate univentionstaff 2022-03-02 15:25:10 CET
Verified:
* Additional package dependency
* Package update
* Advisory
* No adjustment for 5.0 required, as the Listener there is Python3-only
  and typing is already part of Python 3.7