Bug 35391 - Failed first sync may result in attribute deletion
Failed first sync may result in attribute deletion
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-3-errata
Assigned To: Stefan Gohmann
Felix Botner
:
Depends on:
Blocks: 49459
  Show dependency treegraph
 
Reported: 2014-07-17 08:52 CEST by Stefan Gohmann
Modified: 2020-08-12 08:48 CEST (History)
2 users (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 Stefan Gohmann univentionstaff 2014-07-17 08:52:08 CEST
The creation of an S4 object is split into multiple LDAP operations. If the first creation was successful and the later modification failed, then the object is not complete in S4. The later back synchronization from S4 to LDAP will perhaps overwrite/delete attributes.

One possible solution would be to mark an object as successful created after the successful first sync.
Comment 1 Stefan Gohmann univentionstaff 2014-09-03 16:31:21 CEST
A first version has been added. Let's wait for the ucs-test result.

UCS 3.2-3: r53303
UCS 4.0-0: r53306
YAML: r53307
Comment 2 Stefan Gohmann univentionstaff 2014-09-03 21:45:56 CEST
Two test cases have been added:
 tests/52_s4connector/134sync_incomplete_attribute_ad
 tests/52_s4connector/134sync_incomplete_attribute_ucs
Comment 3 Stefan Gohmann univentionstaff 2014-09-04 06:32:13 CEST
Cleanup the locking table:

UCS 3.2-3: r53329
UCS 4.0-0: r53330
YAML: r53331
Comment 4 Felix Botner univentionstaff 2014-09-08 14:50:02 CEST
I couldn't reproduce this issue

-> udm users/user create \
    --set username=fb4 \
    --set password=univention \
    --set lastname=aaa \
    --set description=aaa \
    --set phone="21132423423424242342244234327748238743283264873264876328746328764873264873268746328746238764873264873268743268746328" \
    --set pagerTelephoneNumber=123

sync from ucs: [          user] [       add] cn=fb4,dc=w2k8r2en,dc=test
sync_from_ucs: traceback during modify object: cn=fb4,dc=w2k8r2en,dc=test
sync from ucs: [          user] [    modify] CN=fb4,dc=w2k8r2en,dc=test
sync to ucs:   [          user] [    modify] uid=fb4,dc=w2k8r2en,dc=test

-> univention-ldapsearch -LLL uid=fb4 description pager
dn: uid=fb4,dc=w2k8r2en,dc=test
description: aaa
pager: 123

OK - ucs3.2-3
OK - 4.0
OK - Tests
OK - YAML
Comment 5 Janek Walkenhorst univentionstaff 2014-09-10 17:41:31 CEST
http://errata.univention.de/ucs/3.2/199.html
Comment 6 Florian Best univentionstaff 2020-08-12 08:48:40 CEST
For the reference/bugzilla search:
The test case 52_s4connector/134sync_incomplete_attribute_ucs creates an exception in the S4-Connector on purpose:

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 2441, in sync_from_ucs
    self.lo_s4.lo.modify_ext_s(compatible_modstring(object['dn']), compatible_modlist(modlist), serverctrls=ctrls)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 374, in modify_ext_s
    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 514, in result3
    resp_ctrl_classes=resp_ctrl_classes
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 521, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 106, in _ldap_call
    result = func(*args,**kwargs)
INVALID_SYNTAX: {'info': "0000200B: objectclass_attrs: attribute 'telephoneNumber' on entry 'cn=dscezsgk,cn=users,DC=autotest091c,DC=local' contains at least one invalid value!", 'desc': 'Invalid syntax'}