'samba-tool domain classicupgrade' fails while reading posix attributes

Torsten Kurbad samba-technical at tk-webart.de
Thu Sep 20 11:51:16 MDT 2012

Hi all,

today I upgraded my Samba 4 test install from beta3 to rc1.

To migrate my OpenLDAP backed Samba 3 domain to AD, I copied over the
smb.conf and database files from my existing Samba 3 domain controller
("kmrcserv") to the new one ("pdc").

Afterwards, with beta3, calling

samba-tool domain classicupgrade \
	--dbdir=/root/samba3/db/private/ \
        --targetdir=/root/samba4/ \
        --use-xattrs=yes \

would populate my new AD properly and leave me with a working AD
controller setup.

However, doing the same using rc1 bails out with:

Exporting account policy
Exporting groups
Exporting users
  Skipping wellknown rid=500 (for username=administrator)
Could not find uidNumber in uid=root,ou=People,o=IWM,dc=iwm-kmrc,dc=de
Ignoring group memberships of 'root'
S-1-5-21-1690228159-1232189243-2108207755-1000: Unable to enumerate
group memberships, (-1073741596,NT_STATUS_INTERNAL_DB_CORRUPTION)
  Demoting BDC account trust for kmrcserv, this DC must be elevated to
an AD DC using 'samba-tool domain promote'
Next rid = 41390
Failed to connect to ldap URL 'ldap://ldapsrv.iwm-kmrc.de' - LDAP client
Failed to connect to 'ldap://ldapsrv.iwm-kmrc.de' with backend 'ldap':
 (null) Could not open ldb connection to ldap://ldapsrv.iwm-kmrc.de,
 the error message is: (1, None)
Exporting posix attributes ERROR(<type'exceptions.UnboundLocalError'>):
 uncaught exception - local  variable 'ldb_object' referenced before
File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py",
 line 168, in _run return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py",
 line 1312, in run useeadb=eadb,
File "/usr/lib64/python2.7/site-packages/samba/upgrade.py",
 line 795, in upgrade_from_samba3 homes[username] =
 get_posix_attr_from_ldap_backend(logger, ldb_object, base_dn,
 username, "homeDirectory")

My classic smb.conf contains:

passdb backend = ldapsam:"ldap://ldapsrv.iwm-kmrc.de"

On IRC, I had a nice chat with Andrew Bartlett and Ricky Nance, who
suspect an issue with ldb.

However, I'm too unfamiliar with gdb and the like to get useful
debugging info.
I got as far as running:

gdb --args /usr/bin/python2.7 /usr/bin/samba-tool domain ...

which, unfortunately, only gives me:

Reading symbols from /usr/bin/python2.7...(no debugging symbols
(gdb) r
[Inferior 1 (process 2315) exited with code 0377]
(gdb) bt full
No stack.

Ricky, could you please have a deeper look into that?

I also compiled a bug report at

To that bug I attached a patch that introduces a new commandline option
to 'samba-tool domain classicupgrade' to be able to suppress the
migration of posix attrs. Using that, all other migration steps prove

Any help would be highly appreciated.

Thanks in advance,
  Gentlemen, I want you to know that I am not always right, but I am
  never wrong. -Samuel Goldwyn

More information about the samba-technical mailing list