Bug 55548 - Traceback during migrate Ldap Objects
Traceback during migrate Ldap Objects
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Maximilian Janßen
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-09 16:19 CET by Christina Scheinig
Modified: 2023-01-18 18:46 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.011
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023010921000239
Bug group (optional): bitesize
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2023-01-09 16:19:32 CET
Hitting the migrate Ldap Objects Button in the diagnostic module shows this traceback:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/__init__.py", line 270, in execute
    ret = execute(umc_module, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/56_univention_types.py", line 103, in migrate_objects
    lo.modify(dn, changes)
  File "/usr/lib/python3/dist-packages/univention/admin/uldap.py", line 806, in modify
    return self.lo.modify(dn, changes, serverctrls=serverctrls, response=response, rename_callback=rename_callback)
  File "/usr/lib/python3/dist-packages/univention/uldap.py", line 208, in _decorated
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/uldap.py", line 754, in modify
    self.modify_ext_s(dn, ml, serverctrls=serverctrls, response=response)
  File "/usr/lib/python3/dist-packages/univention/uldap.py", line 208, in _decorated
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/uldap.py", line 813, in modify_ext_s
    rtype, rdata, rmsgid, resp_ctrls = self.lo.modify_ext_s(dn, ml, serverctrls=serverctrls)
  File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 1253, in modify_ext_s
    return self._apply_method_s(SimpleLDAPObject.modify_ext_s,*args,**kwargs)
  File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 1197, in _apply_method_s
    return func(self,*args,**kwargs)
  File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 601, in modify_ext_s
    msgid = self.modify_ext(dn,modlist,serverctrls,clientctrls)
  File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 598, in modify_ext
    return self._ldap_call(self._l.modify_ext,dn,modlist,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
  File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 313, in _ldap_call
    result = func(*args,**kwargs)
TypeError: ('Tuple_to_LDAPMod(): expected a byte string in the list', 'dns/host_record')


----------------

This Patch solved the issue:
diff --git management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/56_univention_types.py management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/56_univention_types.py
index 5598563378..6a408d8227 100755
--- management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/56_univention_types.py
+++ management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/56_univention_types.py
@@ -99,7 +99,7 @@ def migrate_objects(_umc_instance: Instance) -> None:
                new_object_classes = object_classes[:]
                if b'univentionObject' not in object_classes:
                        new_object_classes.append(b'univentionObject')
-               changes = [('objectClass', object_classes, new_object_classes), ('univentionObjectType', [], [module.module for module in modules])]
+               changes = [('objectClass', object_classes, new_object_classes), ('univentionObjectType', [], [module.module.encode('UTF-8') for module in modules])]
                lo.modify(dn, changes)
        raise ProblemFixed(buttons=[])
Comment 1 Maximilian Janßen univentionstaff 2023-01-10 15:56:08 CET
univention-management-console-module-diagnostic
3cd87e62a68d3fba59fb0b4337123917c18a5900 | Bug #55548: yaml
aaec97dcc1f0dac4584ef265d608366c237c7e60 | Bug #55548: Fix diagnostic check 56_univention_types TypeError

added encode statement as suggested in the Description
Comment 2 Florian Best univentionstaff 2023-01-11 13:32:20 CET
OK: migrating works again
OK: YAML