Bug 50542 - _remove_subtree_in_s4 fails if not identifiable object in subtree - KeyError: None
_remove_subtree_in_s4 fails if not identifiable object in subtree - KeyError:...
Status: RESOLVED DUPLICATE of bug 50336
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-25 18:07 CET by Felix Botner
Modified: 2019-11-26 16:12 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
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 Felix Botner univentionstaff 2019-11-25 18:07:09 CET
Duplicate of #49478 ?
Duplicate of #50282 ?

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


We should ignore all objects with key==None in _remove_subtree_in_s4 and remove ou/container only if there are no such objects.
Comment 1 Florian Best univentionstaff 2019-11-26 15:58:52 CET
I think it is a duplicate of Bug #50336.
Comment 2 Felix Botner univentionstaff 2019-11-26 16:02:10 CET
(In reply to Florian Best from comment #1)
> I think it is a duplicate of Bug #50336.
yes,
Comment 3 Florian Best univentionstaff 2019-11-26 16:12:38 CET

*** This bug has been marked as a duplicate of bug 50336 ***