Univention Bugzilla – Bug 55042
o365_usertokens TypeError Tuple_to_LDAPMod expected a byte string in the list
Last modified: 2023-07-18 17:31:57 CEST
Possible Python 3 Migration Bug: root@srv:~# /usr/share/univention-office365/scripts/o365_usertokens --invalidate-tokens --modify Traceback (most recent call last): File "/usr/share/univention-office365/scripts/o365_usertokens", line 150, in <module> lo.modify(ldap_user[0], [('univentionOffice365TokenResetDate', ldap_user_old_reset_date, [next_mod_date.strftime("%Y%m%d")])]) File "/usr/lib/python3/dist-packages/univention/admin/uldap.py", line 803, 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', '20220927') Fixed with: root@srv:~# diff /usr/share/univention-office365/scripts/o365_usertokens /usr/share/univention-office365/scripts/o365_usertokens.fixed 150c150 < lo.modify(ldap_user[0], [('univentionOffice365TokenResetDate', ldap_user_old_reset_date, [next_mod_date.strftime("%Y%m%d")])]) --- > lo.modify(ldap_user[0], [('univentionOffice365TokenResetDate', ldap_user_old_reset_date, [next_mod_date.strftime("%Y%m%d").encode('utf-8')])])
Workaround: deactivate cronjob for now ucr set office365/tokens/cron/enable=false
Any updates?
Fixed in app version office365=5.7 for UCS 5.0 22fead6b univention-office365 2.0.4-14