cname_lookup middleware fails if requested domain does not resolve

Bug #705386 reported by Colin Nicholson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Colin Nicholson

Bug Description

The cname_lookup middleware plugin raises an exception if the domain in the request does not resolve.

Reading the code, it would seem that the NXDOMAIN exception is caught and dealt with, but this does not seem to be the case.

This means that any swift request using localhost or 127.0.0.1 or anything else that doesn't resolve will fail.

Jan 20 12:39:04 Proxy2 proxy-server Error: : Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/middleware/catch_errors.py", line 37, in __call__ return self.app(env, start_response) File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/middleware/healthcheck.py", line 38, in __call__ return self.app(env, start_response) File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/middleware/memcache.py", line 32, in __call__ return self.app(env, start_response) File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/middleware/cname_lookup.py", line 77, in __call__ ttl, found_domain = lookup_cname(a_domain) File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/middleware/cname_lookup.py", line 32, in lookup_cname answer = dns.resolver.query(domain, 'CNAME').rrset File "/usr/local/lib/python2.6/dist-packages/dnspython-1.9.2-py2.6.egg/dns/resolver.py", line 733, in query return get_default_resolver().query(qname, rdtype, rdclass, tcp, source) File "/usr/local/lib/python2.6/dist-packages/dnspython-1.9.2-py2.6.egg/dns/resolver.py", line 672, in query raise NXDOMAIN NXDOMAIN

Related branches

Changed in swift:
assignee: nobody → Colin Nicholson (colin-nicholson)
Changed in swift:
status: New → Fix Committed
Chuck Thier (cthier)
Changed in swift:
milestone: none → 1.2.0
Chuck Thier (cthier)
Changed in swift:
status: Fix Committed → 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.