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


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
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/", line 230, in _run
   return*args, **kwargs)
 File "/usr/lib/python3/dist-packages/samba/netcmd/", line 753, in run
 File "/usr/lib/python3/dist-packages/samba/", line 1598, in join_DC
 File "/usr/lib/python3/dist-packages/samba/", line 1488, in do_join
 File "/usr/lib/python3/dist-packages/samba/", line 1077, in join_replicate


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


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-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