Bug 42079 - "samba-tool fsmo show" fails if DomainDnsZones or ForestDnsZones does not exist
"samba-tool fsmo show" fails if DomainDnsZones or ForestDnsZones does not exist
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-22 09:13 CEST by Christina Scheinig
Modified: 2020-04-24 11:25 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.114
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016081821000197, 2019022721001415
Bug group (optional):
Max CVSS v3 score:
scheinig: Patch_Available+


Attachments
https://git.samba.org/?p=samba.git;a=blob;f=python/samba/netcmd/fsmo.py (19.24 KB, text/x-python)
2016-08-22 09:13 CEST, Christina Scheinig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2016-08-22 09:13:02 CEST
Created attachment 7917 [details]
https://git.samba.org/?p=samba.git;a=blob;f=python/samba/netcmd/fsmo.py

A customer reports, that the output of "samba-tool fsmo show" throws an exception. Ticket#2016081821000197

root@ucs1:~# samba-tool fsmo show
ERROR(ldb): uncaught exception - No such Base DN: CN=Infrastructure,DC=DomainDnsZones,DC=univention,DC=local
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 396, in run
    domaindnszonesMaster = get_fsmo_roleowner(samdb, domaindns_dn)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 40, in get_fsmo_roleowner
    scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"])

The issue could be caused by a system provisioned with a domain role 2000. According to the samba mailing list (https://lists.samba.org/archive/samba/2016-March/198456.html) it is no problem if DomainDnsZones and ForestDnsZones are missing, because DNS is done via MicrosoftDns container, in that case.
This issue is already fixed by Andrew Bartlett.

The new version of fsmo.py (--> see attachement) shows the following output

root@ucs1:~# samba-tool fsmo show
SchemaMasterRole owner: CN=NTDS Settings,CN=UCSDC1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=univention,DC=local
InfrastructureMasterRole owner: CN=NTDS Settings,CN=UCSDC1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=univention,DC=local
RidAllocationMasterRole owner: CN=NTDS Settings,CN=UCSDC1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=univention,DC=local
PdcEmulationMasterRole owner: CN=NTDS Settings,CN=UCSDC1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=univention,DC=local
DomainNamingMasterRole owner: CN=NTDS Settings,CN=UCSDC1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=univention,DC=local
DomainDnsZonesMasterRole: * The 'domaindns' role is not present in this domain
ForestDnsZonesMasterRole: * The 'forestdns' role is not present in this domain

We should use this new version of fsmo.py in ucs.
(https://git.samba.org/?p=samba.git;a=blob;f=python/samba/netcmd/fsmo.py)
Comment 1 Arvid Requate univentionstaff 2016-08-22 14:29:02 CEST
I guess this will be part of Samba 4.5. I'd prefer to actually add the missing container like you did for Ticket #2016081821000197 IIRC.
Comment 2 Christina Scheinig univentionstaff 2016-09-19 10:58:48 CEST
The traceback was fixed by the Andrew Bartlett and this fix is implemented in the customer environment but the missing container were not added.
Comment 3 Arvid Requate univentionstaff 2016-09-27 17:26:33 CEST
untested: I guess the containers may be created by running

samba_upgradedns --dns-backend=BIND9_DLZ


on the S4-Connector host and if additional Samba/AD DCs are present the following commands may be necessary to run on each of them:

======================================================================
eval "$(ucr shell)"
s4connectorservicedcs=$(univention-ldapsearch \
  univentionService="S4 Connector" cn | sed -n 's/^cn: //p')
for part in ForestDnsZones, DomainDnsZones; do
    samba-tool drs replicate --full-sync \
       "$s4connectorservicedcs" "$hostname" \
       "DC=$part,$samba4_ldap_base"
done
======================================================================
Comment 4 Arvid Requate univentionstaff 2016-09-27 17:32:11 CEST
Actually samba_upgradedns should have done this during update to UCS 3.1
(Bug 27457), but the parameter --dns-backend=BIND9_DLZ was missing
(in the univention-samba4 joinscript), so that might be the cause.
Comment 5 Stefan Gohmann univentionstaff 2019-01-03 07:23:59 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.