cname_lookup and eventlet 0.20

Bug #1656891 reported by Romain LE DISEZ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Unassigned

Bug Description

Behavior: when using eventlet 0.20, if the domain from Host header does not have a CNAME record, the cname_lookup middleware throw an exception, so the user get a 500 error.

With this commit[1] included in eventlet 0.20, eventlet define its own NoAnswer exception (and NXDOMAIN). It seems it is not catched by
    except (DNSException, NXDOMAIN, NoAnswer)
in lookup_cname()

But If I change the except to dns.resolver.NoAnswer it works.

[1] https://github.com/eventlet/eventlet/commit/52b09becacd23f384cf69ae37d70c893c43e3b13

Revision history for this message
Romain LE DISEZ (rledisez) wrote :
Revision history for this message
Tim Burke (1-tim-z) wrote :

Traceback looks something like

Mar 7 18:52:17 saio proxy-server: Error: An error occurred:
Traceback (most recent call last):
  File "/vagrant/swift/swift/common/middleware/catch_errors.py", line 41, in handle_request
    resp = self._app_call(env)
  File "/vagrant/swift/swift/common/wsgi.py", line 1058, in _app_call
    resp = self.app(env, self._start_response)
  File "/vagrant/swift/swift/common/middleware/gatekeeper.py", line 102, in __call__
    return self.app(env, gatekeeper_response)
  File "/vagrant/swift/swift/common/middleware/healthcheck.py", line 52, in __call__
    return self.app(env, start_response)
  File "/vagrant/swift/swift/common/middleware/proxy_logging.py", line 346, in __call__
    six.reraise(exc_type, exc_value, exc_traceback)
  File "/vagrant/swift/swift/common/middleware/proxy_logging.py", line 338, in __call__
    iterable = self.app(env, my_start_response)
  File "/vagrant/swift/swift/common/middleware/copy.py", line 318, in __call__
    return self.app(env, start_response)
  File "/vagrant/swift/swift/common/middleware/cname_lookup.py", line 135, in __call__
    ttl, found_domain = lookup_cname(a_domain)
  File "/vagrant/swift/swift/common/middleware/cname_lookup.py", line 58, in lookup_cname
    answer = dns.resolver.query(domain, 'CNAME').rrset
  File "/usr/local/lib/python2.7/dist-packages/eventlet/support/dns/resolver.py", line 1132, in query
    raise_on_no_answer, source_port)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/support/dns/resolver.py", line 1051, in query
    raise NXDOMAIN(qnames=qnames_to_try, responses=nxdomain_responses)
NXDOMAIN: The DNS query name does not exist: saio.swiftstack.org. (txn: tx96c22536d08d443d94b81-0058bf0161)

Changed in swift:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/435770
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=d621277feb235e8da2a1e155a21e80f5daf6d892
Submitter: Jenkins
Branch: master

commit d621277feb235e8da2a1e155a21e80f5daf6d892
Author: Romain LE DISEZ <email address hidden>
Date: Sat Feb 18 17:01:08 2017 +0100

    Fix cname_lookup/eventlet 0.20+ DNS exceptions

    Since version 0.20, eventlet bundle a dnspython version (commit:
    52b09becacd23f384cf69ae37d70c893c43e3b13). Since then, catching
    exceptions require the full module path.

    Closes-Bug: #1656891

    Change-Id: Iac6bb974c1a5d084e450057cf5de1eec80ae21a1

Changed in swift:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.14.0

This issue was fixed in the openstack/swift 2.14.0 release.

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.