Bug 13060 - samba-tool classicupgrade can not access ldap host - NT_STATUS_BAD_NETWORK_NAME
Summary: samba-tool classicupgrade can not access ldap host - NT_STATUS_BAD_NETWORK_NAME
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.7.0
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-28 11:39 UTC by s.walter
Modified: 2017-09-29 09:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description s.walter 2017-09-28 11:39:16 UTC
There seems to be a problem in the samba classicupgrade script (update.py). Migrating from a samba3 (initially even samba2) domain I get the following output:

samba-tool domain classicupgrade --dbdir=/root/samba-classicupgrade-pups --realm=xxx.xxx.xxx --dns-backend=SAMBA_INTERNAL /root/samba-classicupgrade-pups/smb.conf
Reading smb.conf
Provisioning
Exporting account policy
Exporting groups
Exporting users
Next rid = 21109
Failed to connect to ldap URL 'ldap://xxx.xxx.xxx.xxx' - LDAP client internal error: NT_STATUS_BAD_NETWORK_NAME
Failed to connect to 'ldap://xxx.xxx.xxx.xxx' with backend 'ldap': LDAP client internal error: NT_STATUS_BAD_NETWORK_NAME
ERROR(<class 'samba.provision.ProvisioningError'>): uncaught exception - ProvisioningError: Could not open ldb connection to ldap://xxx.xxx.xxx.xxx, the error message is: (1, 'LDAP client internal error: NT_STATUS_BAD_NETWORK_NAME')
  File "/usr/local/samba/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/samba/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 1589, in run
    useeadb=eadb, dns_backend=dns_backend, use_ntvfs=use_ntvfs)
  File "/usr/local/samba/lib64/python2.7/site-packages/samba/upgrade.py", line 669, in upgrade_from_samba3
    raise ProvisioningError("Could not open ldb connection to %s, the error message is: %s" % (url, e))

The script gets problem with this line (around line number 669):
ldb_object = Ldb(url, credentials=creds)
url here in my case contains 'ldap://xxx.xxx.xxx.xxx'

The directive in the old smb.conf was accordingly:
passdb backend = ldapsam:"ldap://xxx.xxx.xxx.xxx"

When I insert (as a short test) 
url='xxx.xxx.xxx.xxx'
as line 669, I get the problem solved.
My feeling is that the script is disturbed by the 'ldap://' prefix of the IP address but I'm not enough into samba LDB to decide.