Bug 51356 - python-ldap from debian buster causes errors in the listener
python-ldap from debian buster causes errors in the listener
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Dirk Wiesenthal
https://github.com/python-ldap/python...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-26 13:30 CEST by Florian Best
Modified: 2021-05-25 16:02 CEST (History)
0 users

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:
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 Florian Best univentionstaff 2020-05-26 13:30:06 CEST
Using python-ldap 3.1.0-2 from debian buster causes tracebacks in the univention-directory-listener:

Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/quota.py", line 216, in handler
    if _is_container_change_relevant(new, old):
  File "/usr/lib/univention-directory-listener/system/quota.py", line 142, in _is_container_change_relevant
    lo = _get_ldap_connection()
  File "/usr/lib/univention-directory-listener/system/quota.py", line 119, in _get_ldap_connection
    connection = univention.uldap.getMachineConnection(ldap_master=False)
  File "/usr/lib/python2.7/dist-packages/univention/uldap.py", line 192, in getMachineConnection
    return access(host=server, port=port, base=ucr['ldap/base'], binddn=ucr['ldap/hostdn'], bindpw=bindpw, start_tls=start_tls, decode_ignorelist=decode_ignorelist, reconnect=reconnect)
  File "/usr/lib/python2.7/dist-packages/univention/uldap.py", line 286, in __init__
    self.__open(ca_certfile)
  File "/usr/lib/python2.7/dist-packages/univention/uldap.py", line 358, in __open
    self.lo = ldap.ldapobject.ReconnectLDAPObject(self.uri, trace_stack_limit=None, retry_max=self.client_connection_attempt, retry_delay=1, bytes_mode=False, bytes_strictness='warn')
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 1098, in __init__
    bytes_strictness=bytes_strictness)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in __init__
    self._trace_level = trace_level or ldap._trace_level
AttributeError: 'module' object has no attribute '_trace_level'

This happens when the python code is loaded with byte optimization (where __debug__ is False):

Patch:
https://github.com/python-ldap/python-ldap/pull/234

For UCS 5.0 we need to prevent this or patch python-ldap.
Comment 1 Florian Best univentionstaff 2020-06-13 09:18:57 CEST
r19059 | Bug #51356: Add upstream patch
r19060 | Bug #51356: rename into .quilt

Package: python-ldap
Version: 3.1.0-2A~5.0.0.202006130916
Comment 2 Dirk Wiesenthal univentionstaff 2020-06-15 12:26:13 CEST
Works again. Thanks!
Comment 3 Florian Best univentionstaff 2021-05-25 16:02:49 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".