Problem:LDAP implementation specific error - DN index delete failed or index generation failed

Problem

If you are having problems modifying or synchronizing users, and you see the following tracebacks in the log file.


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/connector/__init__.py", line 1399, in sync_to_ucs
    result = self.delete_in_ucs(property_type, object, module, position)
  File "/usr/lib/python3/dist-packages/univention/connector/__init__.py", line 1255, in delete_in_ucs
    ucs_object.remove()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 884, in remove
    return self._remove(remove_childs)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1575, in _remove
    self.lo.delete(self.dn)
  File "/usr/lib/python3/dist-packages/univention/admin/uldap.py", line 875, in delete
    raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
univention.admin.uexceptions.ldapError: LDAP Error: Other (e.g., implementation specific) error: DN index delete failed.

or

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/connector/__init__.py", line 1391, in sync_to_ucs
    result = self.add_in_ucs(property_type, object, module, position)
  File "/usr/lib/python3/dist-packages/univention/connector/__init__.py", line 1163, in add_in_ucs
    res = ucs_object.create(serverctrls=serverctrls, response=response)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 554, in create
    self._ldap_pre_ready()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/users/user.py", line 1484, in _ldap_pre_ready
    self.request_lock('uid', self['username'])
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1712, in request_lock
    value = univention.admin.allocators.request(self.lo, self.position, name, value)
  File "/usr/lib/python3/dist-packages/univention/admin/allocators.py", line 220, in request
    return acquireUnique(lo, position, type, value, _type2attr[type], scope=_type2scope[type])
  File "/usr/lib/python3/dist-packages/univention/admin/allocators.py", line 178, in acquireUnique
    univention.admin.locking.lock(lo, position, type, value.encode('utf-8'), scope=scope)
  File "/usr/lib/python3/dist-packages/univention/admin/locking.py", line 97, in lock
    lo.add(dn, al)
  File "/usr/lib/python3/dist-packages/univention/admin/uldap.py", line 772, in add
    raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
univention.admin.uexceptions.ldapError: LDAP Error: Other (e.g., implementation specific) error: index generation failed

Then it looks like the LDAP database has an issue.

Solution

Restore the database using the following instructions:

Mastodon