Univention Bugzilla – Bug 50336
Fix subtree removal in S4-Connector
Last modified: 2022-03-15 09:35:05 CET
The subtree removal in both directions (S4 → UCS, UCS → S4) is wrong. Bug #49956 enhanced (?) the situation and changed/fixed the identification of objects but added workarond for wrong calls to sync_from_ucs(). sync_from_ucs() must be called with a ucs_object but is called with a samba_object definition. sync_to_ucs() must be called with a samba_object but is called with a ucs_object definition. This was analyzed in Bug #49324 comment 8 and their followups. We should fix the calls or implement a different subtree removal strategy. We should revert the workarounds from Bug #49956, so that the data is consistent again (e.g. removal of DNs from some caches and lockingdb) We should fix the endless recursion if there is one object in the subtree which cannot be removed (due to ignore-filter, non-UDM/S4-identifyable, etc.). +++ This bug was initially created as a clone of Bug #49956 +++
Related Bug #50282. Maybe also caused by this bug.
(In reply to Florian Best from comment #1) > Related Bug #50282. Maybe also caused by this bug. And maybe the reason why we didn't yet expericence the endless loop?
Bug #47343: For DNS objects no handling is defined at all. Maybe it can use a generic implementation.
*** Bug 50542 has been marked as a duplicate of this bug. ***
(In reply to Florian Best from comment #4) > *** Bug 50542 has been marked as a duplicate of this bug. *** add OU=myou,DC=four,DC=four add dn: CN=my,OU=myou,DC=four,DC=four objectClass: oncRpc cn: my oncRpcNumber: 1 to samba rm ou=myou via udm udm container/ou remove --dn "ou=myou,dc=four,dc=four" /var/log/univention/connector-s4.log: 25.11.2019 17:55:28.477 LDAP (WARNING): Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/s4connector/__init__.py", line 891, in __sync_file_from_ucs if ((old_dn and not self.sync_from_ucs(key, mapped_object, pre_mapped_ucs_dn, unicode(old_dn, 'utf8'), old, new)) or (not old_dn and not self.sync_from_ucs(key, mapped_object, pre_mapped_ucs_dn, old_dn, old, new))): File "/usr/lib/python2.7/dist-packages/univention/s4connector/s4/__init__.py", line 2613, in sync_from_ucs self.delete_in_s4(object, property_type) File "/usr/lib/python2.7/dist-packages/univention/s4connector/s4/__init__.py", line 2649, in delete_in_s4 if self._remove_subtree_in_s4(object, property_type): File "/usr/lib/python2.7/dist-packages/univention/s4connector/s4/__init__.py", line 2682, in _remove_subtree_in_s4 if not self.sync_from_ucs(key, subobject_s4, back_mapped_subobject['dn']): File "/usr/lib/python2.7/dist-packages/univention/s4connector/s4/__init__.py", line 2301, in sync_from_ucs if self.property[property_type].sync_mode in ['read', 'none']: KeyError: None