Problem
Changes to user profiles (such as password updates) or Organizational Unit (OU) modifications are no longer synchronized from UCS to Active Directory (AD).
ERROR [ -] sync_from_ucs: traceback due to addlist: [('objectClass', [b'top', b'user', b'person', b'organizationalPerson']), ('sn', [b'Lehrer11']), ('givenName', [b'Test029']), ('sAMAccountName', [b'029-Lehrer11'])] | pid=3869420 logname=LDAP.univention.connector.ad func=__init__.sync_from_ucs:2409
WARNING [ -] sync failed, saved as rejected | pid=3869420 logname=LDAP.univention.connector func=__init__.__sync_file_from_ucs:932 x_filename=/var/lib/univention-connector/ad/1789631264.314034 exc_info="Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/univention/connector/__init__.py", line 919, in __sync_file_from_ucs
if not self.sync_from_ucs(key, mapped_object, pre_mapped_ucs_dn, old_dn, object_old, restored=restored):
File "/usr/lib/python3/dist-packages/univention/connector/ad/__init__.py", line 2406, in sync_from_ucs
self.lo_ad.lo.add_ext_s(object['dn'], addlist, serverctrls=ctrls)
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 1016, in add_ext_s
return self._apply_method_s(SimpleLDAPObject.add_ext_s,*args,**kwargs)
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 976, in _apply_method_s
return func(self,*args,**kwargs)
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 222, in add_ext_s
resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 543, in result3
resp_type, resp_data, resp_msgid, decoded_resp_ctrls, retoid, retval = self.result4(
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 553, in result4
ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
File "/usr/lib/python3/dist-packages/ldap/ldapobject.py", line 128, in _ldap_call
result = func(*args,**kwargs)
ldap.ALREADY_EXISTS: {'msgtype': 105, 'msgid': 41, 'result': 68, 'desc': 'Already exists', 'ctrls': [], 'info': '00000524: UpdErr: DSID-031A11FA, problem 6005 (ENTRY_EXISTS), data 0\n'}"
Environment
- Connector Mode: Write-Mode (One-way synchronization from UCS → AD).
- Configuration: The directory structure (OUs) is centrally defined in UCS and enforced via the AD Connector mapping (e.g.,
localmapping.py).
Running the following command reveals rejected objects:
univention-connector-list-rejected
The connector-ad.log file contains repeated synchronization errors, specifically ldap.ALREADY_EXISTS or problem 6005 (ENTRY_EXISTS).
Cause
This issue is triggered when an object is manually moved within the Active Directory (e.g., via AD Users and Computers) instead of being moved through the UCS User Management (UMC).
Because the connector is operating in Write-Mode, it treats the UCS configuration and its mapping as the “Source of Truth” for the object’s location (the Distinguished Name or DN). The following chain of events occurs:
- Detection: The connector checks for the object at the target DN (the path defined by the UCS mapping).
- Mismatch: Since the object was manually moved in AD, the connector finds that the object is missing from the expected location.
- Action: The connector interprets this as the object being deleted from AD and attempts to re-create it at the correct target DN using an
LDAP ADDoperation. - Conflict: The AD server rejects the request with
ALREADY_EXISTSbecause the object still exists within the forest (sharing the same unique SID/GUID), even though it is located at a different DN.
Once an object enters this “rejected” state, all further attribute synchronizations (like password changes) for that object are blocked.
Solution
Immediate Remediation
To restore synchronization for the affected objects:
- Restore Object Position: Manually move the affected objects in Active Directory back to the exact original location (DN) expected by the UCS mapping.
- Trigger Sync: Once the object is back in its mapped position, the AD Connector will recognize it during the next synchronization cycle and clear the rejected status.
Long-term Prevention
- Avoid Manual AD Changes: Never move, rename, or delete users, groups, or OUs directly within the Active Directory.
- Use UCS Management: All structural changes must be performed exclusively via the UCS User Management (UMC) or the UCS command line. This ensures that the mapping remains consistent across both directories.
- Update Mapping: If a different structure in AD is required, modify the
localmapping.pyconfiguration or the UCS structural settings to reflect the desired state.