[Samba] Demoting AD DC failed, now it won't start up after ldb and tdb files removed

Krzysztof Kucybała krzysieq at hotmail.com
Sat Mar 26 17:11:30 UTC 2022


Hi,
I put myself in a big mess today. Had trouble with my domain lately, I figured the best way to get out of the problems on one of the DCs would be to have it rejoin the domain afresh. So I followed the page on demoting an AD DC, except that operation consistently failed with this kind of message:

root at meraki:/var/log/samba# samba-tool domain demote -UAdministrator
Using primarydc.*.* as partner server for the demotion
Password for [*\Administrator]:
Deactivating inbound replication
Asking partner server primarydc.*.* to synchronize from us
Error while replicating out last local changes from 'CN=Schema,CN=Configuration,DC=*,DC=*' for demotion, re-enabling inbound replication
ERROR(<class 'samba.WERRORError'>): Error while sending a DsReplicaSync for partition 'CN=Schema,CN=Configuration,DC=*,DC=*' - (1225, 'WERR_CONNECTION_REFUSED')
  File "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line 789, in run
    drsuapiBind.DsReplicaSync(drsuapi_handle, 1, req1)

So next thing I  figured was to start off clean by stopping samba, removing all tdb and ldb database files and restarting it. But now it won’t come back up:

Mar 26 18:01:59 meraki samba[59940]: [2022/03/26 18:01:59.169953,  0] ../../source4/smbd/server.c:644(binary_smbd_main)
Mar 26 18:01:59 meraki samba[59940]:   samba version 4.13.13-Debian started.
Mar 26 18:01:59 meraki samba[59940]:   Copyright Andrew Tridgell and the Samba Team 1992-2020
Mar 26 18:01:59 meraki samba[59940]: [2022/03/26 18:01:59.172605,  0] ../../lib/util/become_daemon.c:147(daemon_status)
Mar 26 18:01:59 meraki samba[59940]:   daemon_status: daemon 'samba' : Starting process...
Mar 26 18:01:59 meraki samba[59940]: [2022/03/26 18:01:59.706424,  0] ../../lib/util/become_daemon.c:121(exit_daemon)
Mar 26 18:01:59 meraki samba[59940]:   exit_daemon: daemon failed to start: Samba failed to prime database, error code 22
Mar 26 18:01:59 meraki systemd[1]: samba-ad-dc.service: Main process exited, code=exited, status=1/FAILURE
Mar 26 18:01:59 meraki systemd[1]: samba-ad-dc.service: Failed with result 'exit-code'.
Mar 26 18:01:59 meraki systemd[1]: Failed to start Samba AD Daemon.

Could anyone suggest how do I get myself out of this mess that I had put myself into? 😊 I have another DC that seems to be running fine at the moment, I was hoping the one I was trying to clean up would just replicate itself off it again, but that doesn’t seem to be the case currently…. Any help will be very appreciated 😊
Cheers,
Chris


More information about the samba mailing list