Daan Nusman
2021-Jul-31 14:18 UTC
[Samba] DC upgrade: "Samba failed to prime database" (4.7.6-Ubuntu -> 4.14.6)
Hi everyone, I am in the procress of trying to upgrade a DC from a packaged "4.7.6-Ubuntu" to a self-compiled 4.14.6. I copied a self-compiled version of Samba over to /usr/local/samba, and copied the config files, databases (private folder etc) from their typical debian locations too. When I try to start the new samba with debug level 10, the syslog says: Jul 31 16:02:43 ad1 samba[3001]: [2021/07/31 16:02:43.347737,? 0, pid=3001, effective(0, 0), real(0, 0)] ../../source4/samba/server.c:646(binary_smbd_main) Jul 31 16:02:43 ad1 samba[3001]:?? samba version 4.14.6 started. Jul 31 16:02:43 ad1 samba[3001]:?? Copyright Andrew Tridgell and the Samba Team 1992-2021 Jul 31 16:02:43 ad1 samba[3003]: [2021/07/31 16:02:43.620010,? 0, pid=3003, effective(0, 0), real(0, 0)] ../../lib/util/become_daemon.c:122(exit_daemon) Jul 31 16:02:43 ad1 samba[3003]:?? exit_daemon: daemon failed to start: Samba failed to prime database, error code 22 I've seen this error documented on a downgrade, not an upgrade (see https://wiki.samba.org/index.php/Downgrading_an_Active_Directory_DC#Samba_failed_to_prime_database.2C_error_code_22). * Should this work or should I give up and go for a scary DC rejoin? * If this should work, how can I find out more about what's going wrong? Let me know if I should provide config files, (what) logs, etc. Thank you, Daan
Rowland Penny
2021-Jul-31 14:58 UTC
[Samba] DC upgrade: "Samba failed to prime database" (4.7.6-Ubuntu -> 4.14.6)
On Sat, 2021-07-31 at 16:18 +0200, Daan Nusman via samba wrote:> Hi everyone, > > I am in the procress of trying to upgrade a DC from a packaged > "4.7.6-Ubuntu" to a self-compiled 4.14.6.Why upgrade like that ?> > I copied a self-compiled version of Samba over to /usr/local/samba, > and > copied the config files, databases (private folder etc) from their > typical debian locations too.I cannot recommend doing that.> > When I try to start the new samba with debug level 10, the syslog > says: > > Jul 31 16:02:43 ad1 samba[3001]: [2021/07/31 16:02:43.347737, 0, > pid=3001, effective(0, 0), real(0, 0)] > ../../source4/samba/server.c:646(binary_smbd_main) > Jul 31 16:02:43 ad1 samba[3001]: samba version 4.14.6 started. > Jul 31 16:02:43 ad1 samba[3001]: Copyright Andrew Tridgell and the > Samba Team 1992-2021 > Jul 31 16:02:43 ad1 samba[3003]: [2021/07/31 16:02:43.620010, 0, > pid=3003, effective(0, 0), real(0, 0)] > ../../lib/util/become_daemon.c:122(exit_daemon) > Jul 31 16:02:43 ad1 samba[3003]: exit_daemon: daemon failed to > start: > Samba failed to prime database, error code 22 > > I've seen this error documented on a downgrade, not an upgrade (see > https://wiki.samba.org/index.php/Downgrading_an_Active_Directory_DC#Samba_failed_to_prime_database.2C_error_code_22). > > > * Should this work or should I give up and go for a scary DC rejoin?No, I don't think it will work and joining a new DC isn't scary :-) Ubuntu and Samba 4.7.6 means 18.04, so I suggest you create a new computer running 20.04, then install Samba from here: https://apt.van-belle.nl/ Then join this as a new DC, transfer all the FSMO roles to the new DC and then demote the original DC. Rowland
Daan Nusman
2021-Aug-04 08:50 UTC
[Samba] DC upgrade: "Samba failed to prime database" (4.7.6-Ubuntu -> 4.14.6)
Hello, first of all: thank you, got a secondary DC working now on the latest Ubuntu. On 2021-07-31 16:58, Rowland Penny via samba wrote:> On Sat, 2021-07-31 at 16:18 +0200, Daan Nusman via samba wrote: >> Hi everyone, >> >> I am in the procress of trying to upgrade a DC from a packaged >> "4.7.6-Ubuntu" to a self-compiled 4.14.6. > Why upgrade like that ?I tried updating like this because the Ubuntu packages were lagging. I did not know about the repo.>> I copied a self-compiled version of Samba over to /usr/local/samba, >> and >> copied the config files, databases (private folder etc) from their >> typical debian locations too. > I cannot recommend doing that.In-place upgrading seems the main recommendation on the wiki (https://wiki.samba.org/index.php/Upgrading_a_Samba_AD_DC), though I'll admit that this is an update over a major release.> >> * Should this work or should I give up and go for a scary DC rejoin? > No, I don't think it will work and joining a new DC isn't scary :-)On the wiki there's strongly worded advice not to do this ("Joining a DC to domain can be a troublesome process for some users, and it can be difficult to recover your DC if something goes wrong. Only consider using this approach if you are an advanced Samba user") so I didn't. In the end it worked out fine for me, and I certainly am not an advanced Samba user. Maybe the Wiki needs an update? I have documented the entire process, and am willing to give it a go if an experienced person would check the text.> Ubuntu and Samba 4.7.6 means 18.04, so I suggest you create a new > computer running 20.04, then install Samba from here: > https://apt.van-belle.nl/ > > Then join this as a new DC, transfer all the FSMO roles to the new DC > and then demote the original DC.This has worked for me, thank you again. ~ Daan