designate unit test fails with dnspython 2.2.0

Bug #1958858 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Critical
Unassigned

Bug Description

Hi,

as per the buildd log here:

https://buildd.debian.org/status/package.php?p=designate
https://buildd.debian.org/status/fetch.php?pkg=designate&arch=all&ver=1%3A13.0.0-4&stamp=1642808718&raw=0

designate fails to run its unit tests with python3-dnspython 2.2.0. Failure log below. Please help me to fix this.

Also, since version 2.2.0, there's no need to use Eventlet greenDNS, as dnspython offers non-blocking DNS requests by itself. It'd be great to switch to that.

======================================================================
FAIL: designate.tests.unit.test_dnsutils.TestUtils.test_from_dnspython_zone
designate.tests.unit.test_dnsutils.TestUtils.test_from_dnspython_zone
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/designate/tests/unit/test_dnsutils.py", line 97, in test_from_dnspython_zone
    dnspython_zone = dnszone.from_text(
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 1090, in from_text
    reader.read()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 451, in read
    self._rr_line()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 214, in _rr_line
    self.txn.add(name, ttl, rd)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 145, in add
    return self._add(False, args)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 394, in _add
    raise ValueError(f'{method} has non-origin SOA')
ValueError: add() has non-origin SOA

======================================================================
FAIL: designate.tests.unit.test_dnsutils.TestUtils.test_from_dnspython_zone_no_soa
designate.tests.unit.test_dnsutils.TestUtils.test_from_dnspython_zone_no_soa
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/designate/tests/unit/test_dnsutils.py", line 110, in test_from_dnspython_zone_no_soa
    dnspython_zone = dnszone.from_text(
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 1090, in from_text
    reader.read()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 451, in read
    self._rr_line()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 214, in _rr_line
    self.txn.add(name, ttl, rd)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 145, in add
    return self._add(False, args)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 397, in _add
    existing = self._get_rdataset(name, rdataset.rdtype,
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 985, in _get_rdataset
    return self.version.get_rdataset(name, rdtype, covers)
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 885, in get_rdataset
    node = self.get_node(name)
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 881, in get_node
    name = self._validate_name(name)
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 873, in _validate_name
    if not name.is_subdomain(self.zone.origin):
  File "/usr/lib/python3/dist-packages/dns/name.py", line 456, in is_subdomain
    (nr, _, _) = self.fullcompare(other)
  File "/usr/lib/python3/dist-packages/dns/name.py", line 404, in fullcompare
    oabs = other.is_absolute()
AttributeError: 'NoneType' object has no attribute 'is_absolute'

======================================================================
FAIL: designate.tests.unit.test_dnsutils.TestUtils.test_parse_zone
designate.tests.unit.test_dnsutils.TestUtils.test_parse_zone
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/designate/tests/unit/test_dnsutils.py", line 125, in test_parse_zone
    dnspython_zone = dnszone.from_text(
  File "/usr/lib/python3/dist-packages/dns/zone.py", line 1090, in from_text
    reader.read()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 451, in read
    self._rr_line()
  File "/usr/lib/python3/dist-packages/dns/zonefile.py", line 214, in _rr_line
    self.txn.add(name, ttl, rd)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 145, in add
    return self._add(False, args)
  File "/usr/lib/python3/dist-packages/dns/transaction.py", line 394, in _add
    raise ValueError(f'{method} has non-origin SOA')
ValueError: add() has non-origin SOA

Revision history for this message
Michael Johnson (johnsom) wrote :

Yes, we are aware that dnspython 2.2.0 is broken and have been working on it over the weekend. Upstream bug (with three PRs) is here: https://github.com/rthalley/dnspython/issues/766

We will be blocking dnspython 2.2.0 today to get the gates working again now that we have confirmed it is a dnspython bug.

Changed in designate:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

FYI, I have rebuilt python3-dnspython with the above patch, and it fixed the issue for me indeed.

Revision history for this message
Michael Johnson (johnsom) wrote :

I have blocked dnspython 2.2.0 in global requirements and upper-constraints here:
https://review.opendev.org/c/openstack/requirements/+/826122

This will unblock the jobs until 2.2.1 is released.

Revision history for this message
Michael Johnson (johnsom) wrote :

dnspython 2.2.1 has been released with the required fix.
I am going to close this bug.

Changed in designate:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.