Bug 55549 - Traceback in migrate Server Role Windows
Traceback in migrate Server Role Windows
Status: NEW
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-09 16:22 CET by Christina Scheinig
Modified: 2023-01-09 16:23 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:22:18 CET
Hitting the migrate button in the diagnostic "Server Role Windows" shows the following 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/57_univention_server_role_windows.py", line 110, 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', 'w')

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

This Patch fixed the issue:
diff --git management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/57_univention_server_role_windows.py management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/57_univention
index 9a42434d63..dd0cfdcf34 100755
--- management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/57_univention_server_role_windows.py
+++ management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/57_univention_server_role_windows.py
@@ -106,7 +106,7 @@ def migrate_objects(_umc_instance: Instance) -> None:
                if not server_role:
                        continue
                for dn in objs[server_role]:
-                       changes = [('univentionServerRole', None, server_role)]
+                       changes = [('univentionServerRole', None, server_role.encode('UTF-8'))]
                        lo.modify(dn, changes)
        raise ProblemFixed(buttons=[])