upgradeprovision --full fails to find CN=NTDS Settings

Michael Wood esiotrot at gmail.com
Sat Dec 17 03:39:17 MST 2011


I'm trying to upgrade an old installation of Samba 4 from
4.0.0alpha12-GIT-77b9b97 to 4.0.0alpha18-GIT-35605fa.

The build works fine.

samba-tool dbcheck --fix finds and fixes a bunch of things.

upgradeprovision completes without complaint.

But upgradeprovision --full fails as follows (with some debug print
statements added just before the failure):

Creating a reference provision
No IPv6 address will be assigned
Copy privilege
Update base samdb by searching difference with reference one
Starting update of samdb
There are 76 missing objects
Reloading a merged schema, which might trigger reindexing so please be patient
Schema reloaded!
dn= CN=NTDS Settings,CN=SAMBA,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=example,DC=com
basedn= DC=example,DC=com
attrs= msDS-hasMasterNCs
res.count == 0
Exception during upgrade of samdb:
Traceback (most recent call last):
  File "/usr/local/samba/sbin/upgradeprovision", line 1205, in update_partition
  File "/usr/local/samba/sbin/upgradeprovision", line 1080, in update_present
    basedn, usns, samdb)
  File "/usr/local/samba/sbin/upgradeprovision", line 904, in
    curval, refval, delta)
  File "/usr/local/samba/sbin/upgradeprovision", line 788, in handle_links
    for e in res[0][att]:
IndexError: list index out of range
Update failed
Rolling back all changes. Check the cause of the problem
Your system is as it was before the upgrade

So it seems that this search for CN=NTDS Settings returns nothing:

    res = samdb.search(expression="dn=%s" % dn, base=basedn,
                        controls=["search_options:1:2", "reveal:1"],

The strange thing is that if I do the same search from the command
line it works fine:

# ldbsearch -H private/sam.ldb --controls="search_options:1:2
reveal:1" "dn=CN=NTDS
# record 1
dn: CN=NTDS Settings,CN=SAMBA,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=example,DC=com
msDS-hasMasterNCs: CN=Configuration,DC=example,DC=com
msDS-hasMasterNCs: CN=Schema,CN=Configuration,DC=example,DC=com
msDS-hasMasterNCs: DC=example,DC=com

# returned 1 records
# 1 entries
# 0 referrals

I tried adding "relax:1" to the list of controls, but that did not
make any difference.

Any ideas?

Michael Wood <esiotrot at gmail.com>

More information about the samba-technical mailing list