Bug 1531902

Summary: Samba AD-DC + BIND9_DLZ : provisioning
Product: [Fedora] Fedora Reporter: Everard Brown <bugzilla.redhat>
Component: samba4Assignee: Orphan Owner <extras-orphan>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: abokovoy, asn, extras-orphan, gdeschner, mbarnes, sbose, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-06 18:25:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Everard Brown 2018-01-06 15:31:59 UTC
Description of problem:
Unable to use BIND9_DLZ with samba

Version-Release number of selected component (if applicable):
samba-4.7.4-0.fc27.x86_64

How reproducible:
Always

Steps to Reproduce:
1. dnf install samba samba-dc samba-dc-bind-dlz
2. samba-tool domain provision --use-rfc2307 --dns-backend=BIND9_DLZ --domain=DOM --realm=DOM.EXAMPLE.COM --adminpass=Passw@rd
3.

Actual results:
Looking up IPv4 addresses
More than one IPv4 address found. Using 172.17.0.1
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=dom,DC=example,DC=com
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=dom,DC=example,DC=com
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Failed to setup database for BIND, AD based DNS cannot be used
ERROR(<type 'exceptions.OSError'>): uncaught exception - [Errno 2] No such file or directory
  File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 474, in run
    nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode)
  File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 2191, in provision
    skip_sysvolacl=skip_sysvolacl)
  File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 1845, in provision_fill
    targetdir=targetdir, fill_level=samdb_fill)
  File "/usr/lib64/python2.7/site-packages/samba/provision/sambadns.py", line 1163, in setup_ad_dns
    hostip6=hostip6, targetdir=targetdir)
  File "/usr/lib64/python2.7/site-packages/samba/provision/sambadns.py", line 1215, in setup_bind9_dns
    create_samdb_copy(samdb, logger, paths, names, names.domainsid, domainguid)
  File "/usr/lib64/python2.7/site-packages/samba/provision/sambadns.py", line 854, in create_samdb_copy
    os.path.join(dns_dir, "sam.ldb"))
  File "/usr/lib64/python2.7/site-packages/samba/tdb_util.py", line 36, in tdb_copy
    status = subprocess.call(tdbbackup_cmd, close_fds=True, shell=False)
  File "/usr/lib64/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1025, in _execute_child
    raise child_exception

Expected results:
Samba provisioning should work

Additional info:
If we provision the domain without '--dns-backend=BIND9_DLZ', it works.

Subsequently, we execute: samba_upgradedns --dns-backend=BIND9_DLZ

Reading domain information
DNS accounts already exist
No zone file /var/lib/samba/bind-dns/dns/DOM.EXAMPLE.COM.zone
DNS records will be automatically created
DNS partitions already exist
Adding dns-sisko account
Failed to setup database for BIND, AD based DNS cannot be used
Traceback (most recent call last):
  File "/usr/sbin/samba_upgradedns", line 537, in <module>
    domainguid)
  File "/usr/lib64/python2.7/site-packages/samba/provision/sambadns.py", line 854, in create_samdb_copy
    os.path.join(dns_dir, "sam.ldb"))
  File "/usr/lib64/python2.7/site-packages/samba/tdb_util.py", line 36, in tdb_copy
    status = subprocess.call(tdbbackup_cmd, close_fds=True, shell=False)
  File "/usr/lib64/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1025, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Comment 1 Everard Brown 2018-01-06 18:25:06 UTC

*** This bug has been marked as a duplicate of bug 1508092 ***