[Samba] [PATCH] Re: samba-tool domain classicupgrade with LDAP backend

Juan Asensio Sánchez okelet at gmail.com
Wed Jan 9 02:30:26 MST 2013


Hi Andrew

These are the new results. After running the classicupgrade with "log level
= 10" this is the output:

# cd ~/samba-4.0.0
# patch -p1 <
~/0001-s4-libcli-resolv-Add-alias-hosts-for-host-in-name-re.patch
# patch -p1 <
~/0001-samba-tool-domain-classicupgrade-Make-failure-to-con.patch
# make uninstall && rm -Rf /usr/local/samba/ && make clean && make && make
install
# samba-tool domain classicupgrade --dbdir ~/sambav3 --realm
MYSUBORG1.MYORG.TEST --use-xattrs=yes ~/sambav3/smb.conf

....
Looking up login cache for user somecomputeraccount$
No cache entry found
No cache entry, bad count = 0, bad time = 0
smbldap_search_ext: base => [o=mysuborg1,dc=myorg,dc=es], filter =>
[(&(sambaSid=S-1-5-21-2808594902-4197342290-404042715-31036)(|(objectClass=sambaGroupMapping)(objectClass=sambaSamAccount)))],
scope => [2]
attribute sambaGroupType does not exist
Adding cache entry with key =
IDMAP/SID2XID/S-1-5-21-5555555555-66666666666-777777777-31036 and timeout =
Wed Jan 16 09:36:19 2013
 (604800 seconds ahead)
Adding cache entry with key = IDMAP/UID2SID/15018 and timeout = Wed Jan 16
09:36:19 2013
 (604800 seconds ahead)
smbldap_search_ext: base => [o=mysuborg1,dc=myorg,dc=es], filter =>
[(&(objectClass=posixGroup)(|(memberUid=somecomputeraccount$)(gidNumber=10003)))],
scope => [2]
Next rid = 12801001
Failed to connect to ldap URL 'ldap://ldappruebas.myorg.es' - LDAP client
internal error: NT_STATUS_BAD_NETWORK_NAME
Failed to connect to 'ldap://ldappruebas.myorg.es' with backend 'ldap':
(null)
Could not open ldb connection to ldap://ldappruebas.myorg.es, the error
message is: (1, None)
Exporting posix attributes
smbldap_search_paged: base => [o=mysuborg1,dc=myorg,dc=es], filter =>
[(&(uid=*)(objectclass=sambaSamAccount))],scope => [2], pagesize => [1024]
smbldap_search_ext: base => [o=mysuborg1,dc=myorg,dc=es], filter =>
[(&(uid=*)(objectclass=sambaSamAccount))], scope => [2]
smbldap_search_paged: search was successful
"description" not found
"description" not found
[...lots of same line...]
"description" not found
"description" not found
ERROR(<type 'exceptions.UnboundLocalError'>): uncaught exception - local
variable 'ldb_object' referenced before assignment
  File
"/usr/local/samba/lib/python2.6/site-packages/samba/netcmd/__init__.py",
line 175, in _run
    return self.run(*args, **kwargs)
  File
"/usr/local/samba/lib/python2.6/site-packages/samba/netcmd/domain.py", line
1318, in run
    useeadb=eadb, dns_backend=dns_backend, use_ntvfs=use_ntvfs)
  File "/usr/local/samba/lib/python2.6/site-packages/samba/upgrade.py",
line 800, in upgrade_from_samba3
    homes[username] = get_posix_attr_from_ldap_backend(logger, ldb_object,
base_dn, username, "homeDirectory")
The connection to the LDAP server was closed


I don't see any additional relevant information... The lsbsearch command
works fine:

# ldbsearch -b "dc=myorg,dc=es" -H
ldap://ldappruebas.myorg.es--simple-bind-dn="cn=readonlyuser"
--password=XXXXXXXX "(uid=someuser)" uid

# the results...


After applying the second patch, when the connection fails the exporting
posix attributes step doesn't start.

....
Next rid = 12801001
Failed to connect to ldap URL 'ldap://ldappruebas.myorg.es' - LDAP client
internal error: NT_STATUS_BAD_NETWORK_NAME
Failed to connect to 'ldap://ldappruebas.myorg.es' with backend 'ldap':
(null)
ERROR(<type 'exceptions.TypeError'>): uncaught exception - __init__() takes
exactly 2 arguments (4 given)
  File
"/usr/local/samba/lib/python2.6/site-packages/samba/netcmd/__init__.py",
line 175, in _run
    return self.run(*args, **kwargs)
  File
"/usr/local/samba/lib/python2.6/site-packages/samba/netcmd/domain.py", line
1318, in run
    useeadb=eadb, dns_backend=dns_backend, use_ntvfs=use_ntvfs)
  File "/usr/local/samba/lib/python2.6/site-packages/samba/upgrade.py",
line 790, in upgrade_from_samba3
    raise ProvisioningError("Could not open ldb connection to %s, the error
message is: %s", url, e)
The connection to the LDAP server was closed


I don't know what more to test...

Regards and thanks again.




2013/1/8 Andrew Bartlett <abartlet at samba.org>

> On Tue, 2013-01-08 at 18:42 +1100, Andrew Bartlett wrote:
> > On Fri, 2013-01-04 at 12:53 +0100, Juan Asensio Sánchez wrote:
> > > Hi Andrew
> > >
> > >
> > > Unfortunately, after applying the patch, recompile, uninstall and
> > > install again, I am getting the same error:
> > >
> > > # cd ~/samba-4.0.0
> > > # patch -p1 <
> > > ~/0001-s4-libcli-resolv-Add-alias-hosts-for-host-in-name-re.patch
> > > # make uninstall && rm -Rf /usr/local/samba/ && make clean && make &&
> > > make install
> > > # samba-tool domain classicupgrade --dbdir ~/sambav3 --realm
> > > SSCC.SACYL.TEST --use-xattrs=yes ~/sambav3/smb.conf -d9
> > >
> > > ...
> > > init_sam_from_ldap: Entry found for user: XXXXXXX
> > > init_sam_from_ldap: Entry found for user: XXXXXXX$
> > > Next rid = 12801001
> > > Failed to connect to ldap URL 'ldap://XXXXXX.XXXXX.es' - LDAP client
> > > internal error: NT_STATUS_BAD_NETWORK_NAME
> > > Failed to connect to 'ldap://XXXXXX.XXXXX.es' with backend 'ldap':
> > > (null)
> > > Could not open ldb connection to ldap://XXXXXX.XXXXX.es, the error
> > > message is: (1, None)
> >
> > Can you set 'log level = 10' in your smb.conf and try again, I'm very
> > must lost as to what the error is if this doesn't fix it.
> >
> > Can you contact this host using ldbsearch?  eg:
> >
> >  ldbsearch -H ldap://XXXXXX.XXXXX.es
> >
> > Andrew Bartlett
>
> Also, can you verify that this patch makes the classicupgrade fail right
> after the failed connection, rather than hobbling on and failing due to
> an un-set variable?
>
> Thanks,
>
> Andrew Bartlett
>
> --
> Andrew Bartlett                                http://samba.org/~abartlet/
> Authentication Developer, Samba Team           http://samba.org
>
>


More information about the samba mailing list