Bug 44104 - DNS SOA sync_to_ucs reject
DNS SOA sync_to_ucs reject
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.3-2-errata
Assigned To: Arvid Requate
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-28 12:33 CEST by Arvid Requate
Modified: 2018-11-07 14:33 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
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.069
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017032721000098, 2018011221000555, 2018072021000271
Bug group (optional):
Max CVSS v3 score:
requate: Patch_Available+


Attachments
SOA_mname.patch (694 bytes, patch)
2017-03-28 12:33 CEST, Arvid Requate
Details | Diff
ucs-test.log (4.03 KB, text/x-log)
2018-10-29 13:30 CET, Arvid Requate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2017-03-28 12:33:03 CEST
Created attachment 8664 [details]
SOA_mname.patch

In an AD-Takeover customer environment synchronization of some DC=@ SOA DNS records failed in the S4-Connector sync_to_ucs direction due to a trivial missing trailing dot:

==============================================================================
28.03.2017 12:10:55,864 LDAP        (PROCESS): sync to ucs: Resync rejected dn: DC=@,DC=0.168.192.in-addr.arpa,CN=MicrosoftDNS,DC=DomainDnsZones,DC=foo,DC=bar
28.03.2017 12:10:55,868 LDAP        (PROCESS): sync to ucs:   [           dns] [    modify] zonename=0.168.192.in-addr.arpa,cn=dns,dc=foo,dc=bar
28.03.2017 12:10:55,871 LDAP        (ERROR  ): Unknown Exception during sync_to_ucs
28.03.2017 12:10:55,871 LDAP        (ERROR  ): Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 1472, in sync_to_ucs
    result = self.property[property_type].ucs_sync_function(self, property_type, object)
  File "/usr/lib/pymodules/python2.7/univention/s4connector/s4/dns.py", line 1677, in con2ucs
    elif object['modtype'] in ['delete']:
  File "/usr/lib/pymodules/python2.7/univention/s4connector/s4/dns.py", line 1426, in ucs_zone_create
    else:
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 317, in modify
    return self._modify(modify_childs, ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 813, in _modify
    self.lo.modify(self.dn, ml, ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/uldap.py", line 471, in modify
    raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
ldapError: Type or value exists: nSRecord: value #0 provided more than once
==============================================================================


The attached patch fixed the issue and would improve robustness of the product.


+++ This bug was initially created as a clone of Bug #44103 +++
Comment 1 Florian Best univentionstaff 2017-03-28 12:55:58 CEST
+			if mname and mname[-1] != ".":
→ More pythonic is:
if not mname.endswith('.'):
Comment 2 Michael Grandjean univentionstaff 2018-01-22 22:14:12 CET
I saw this today after backup2master in an UCS@school Multi-School enivronment with a lot of DNS zones. No clue why this happend, though.
Comment 3 Michael Grandjean univentionstaff 2018-01-22 22:19:18 CET
Just to make this clear: The patch works fine :)
Comment 4 Arvid Requate univentionstaff 2018-10-16 20:59:15 CEST
f00b47e465 | Fix sync_to_ucs reject for DNS SOAs with
             trailing dot missing in the NS RR.
b2db0d0cf8 | Advisory
Comment 5 Felix Botner univentionstaff 2018-10-19 15:11:18 CEST
not sure but i think we want this

--- a/services/univention-s4-connector/modules/univention/s4connector/s4/dns.py
+++ b/services/univention-s4-connector/modules/univention/s4connector/s4/dns.py
@@ -1475,7 +1475,7 @@ def ucs_zone_create(s4connector, object, dns_type):
                        if mname and not mname.endswith("."):
                                mname = "%s." % mname
                        if mname not in ns:
-                               ns.insert(0, soa['mname'])
+                               ns.insert(0, mname)
                        zone['nameserver'] = ns
                        modify = True
                if soa['rname'].replace('.', '@', 1) != zone['contact'].rstrip('.'):
Comment 6 Arvid Requate univentionstaff 2018-10-23 13:40:27 CEST
1efd752847 | fix, also for initial add
b00b5c7ecf | Advisory
Comment 8 Arvid Requate univentionstaff 2018-10-24 18:46:36 CEST
The failing test cases don't cover the adjusted code and they work on my VM. I've adjusted the test cases none the less, improving the order of waits.

17617fb6ca | Improve test stability of 175sync_create_dns_a*_create
Comment 9 Felix Botner univentionstaff 2018-10-25 13:55:26 CEST
test still fail
Comment 10 Arvid Requate univentionstaff 2018-10-29 13:30:32 CET
Created attachment 9715 [details]
ucs-test.log

I have run ucs-ec2-create -c autotest-091-master-s4connector.cfg and run the two test cases manually (./175sync_create_dns_a*_record -f) and they succeeded, see attachment.
Comment 11 Arvid Requate univentionstaff 2018-10-29 15:00:34 CET
Ah, got it:

7a2feaefd0 | Perform a case insensitive compare of ns records
ac47668447 | Advisory
Comment 12 Felix Botner univentionstaff 2018-11-01 15:48:34 CET
OK - sync to ucs with SOA without trailing dot
OK - tests
OK - yaml
Comment 13 Arvid Requate univentionstaff 2018-11-07 14:33:42 CET
<http://errata.software-univention.de/ucs/4.3/304.html>