Problem: 96univention-samba4 fails with ctx.local_samdb.transaction_commit

Problem:

96univention-samba4 fails with a traceback.

Repack: re-packed 480000 records so far
Repack: re-packed 490000 records so far
An operation failed during a batch mode transaction, the transaction was rolled back
Could not find machine account in secrets database: Failed to fetch machine account password for SYSC from both secrets.ldb (Could not find entry to match filter: '(&(flatname=SCHEIN)(objectclass=primaryDomain))' base: 'cn=Primary Domains': No such object: dsdb_search at ../../source4/dsdb/common/util.c:5157) and from /var/lib/samba/private/secrets.tdb: NT_S
TATUS_CANT_ACCESS_DOMAIN_INFO
ERROR(ldb): uncaught exception - end_trans error on DC=schein,DC=ig: An operation failed during a batch mode transaction, the transaction was rolled back
 File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 230, in _run
   return self.run(*args, **kwargs)
 File "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line 753, in run
   backend_store_size=backend_store_size)
 File "/usr/lib/python3/dist-packages/samba/join.py", line 1598, in join_DC
   ctx.do_join()
 File "/usr/lib/python3/dist-packages/samba/join.py", line 1488, in do_join
   ctx.join_replicate()
 File "/usr/lib/python3/dist-packages/samba/join.py", line 1077, in join_replicate
   ctx.local_samdb.transaction_commit()

Solution:

Check the master for errors.

samba-tool dbcheck --cross-ncs --fix --yes
samba-tool dbcheck --reindex

If you receive errors during index, this is presumably the root cause of the error in the join.log.
These errors have to be fixed

Examples:

root@ucs2:~# samba-tool dbcheck --reindex

../../ldb_key_value/ldb_kv_index.c:2839: unique index violation on objectSid in CN=Guest,CN=Users,DC=schein,DC=local, conflicts with objectGUID 0013178c-daae-421b-a0a2-fbbb9

In this case there was an still existing deleted object.


samba-tool dbcheck --cross-ncs --reindex
Re-indexing...
re-indexed database:  (68, 'reindexing failed: Entry CN=Verwaltung-Drucker OG 1 
 Z003,CN=Users,DC=schein,DC=ig already exists')

Here we had duplicate entries in the database, because there were 2 spaces in the object name. Both should be deleted, but at least one of them has to be deleted.

1 Like
Mastodon