cinder-api fails to listen on ipv6 if pythondns is installed

Bug #1471049 reported by Mark Kirkwood
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Unassigned

Bug Description

If osapi_volume_listen is an ipv6 address then attempting to start the cinder-api service gets:

2015-07-03 12:49:57.696 TRACE cinder Traceback (most recent call last):
2015-07-03 12:49:57.696 TRACE cinder File "/usr/local/bin/cinder-api", line 6, in <module>
2015-07-03 12:49:57.696 TRACE cinder exec(compile(open(__file__).read(), __file__, 'exec'))
2015-07-03 12:49:57.696 TRACE cinder File "/opt/stack/cinder/bin/cinder-api", line 60, in <module>
2015-07-03 12:49:57.696 TRACE cinder server = service.WSGIService('osapi_volume')
2015-07-03 12:49:57.696 TRACE cinder File "/opt/stack/cinder/cinder/service.py", line 345, in __init__
2015-07-03 12:49:57.696 TRACE cinder port=self.port)
2015-07-03 12:49:57.696 TRACE cinder File "/opt/stack/cinder/cinder/wsgi.py", line 177, in __init__
2015-07-03 12:49:57.696 TRACE cinder family=family)
2015-07-03 12:49:57.696 TRACE cinder File "/usr/local/lib/python2.7/dist-packages/eventlet/convenience.py", line 39, in listen
2015-07-03 12:49:57.696 TRACE cinder sock.bind(addr)
2015-07-03 12:49:57.696 TRACE cinder File "/usr/lib/python2.7/socket.py", line 224, in meth
2015-07-03 12:49:57.696 TRACE cinder return getattr(self._sock,name)(*args)
2015-07-03 12:49:57.696 TRACE cinder gaierror: [Errno -9] Address family for hostname not supported

The environment is Openstack Juno on Ubuntu 14.04 (devstack )

Note that pythondns is installed as a dependency if swift is installed, so is quite easy to trigger this.

This looks to be similar to https://bugs.launchpad.net/swift/+bug/1361204 and https://bugs.launchpad.net/nova/+bug/1164822 . Despite the latter suggesting that eventlet has fixed the issue it does not appear to be working without kludging an env variable (as nova does - see below).

Nova gets around this by setting EVENTLET_NO_GREENDNS=yes in __init__.py. This type of fix should work for cinder too, or alternatively in the cinder-api service file.

affects: swift → cinder
description: updated
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Needs repro.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/396744

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

Reviewed: https://review.openstack.org/396744
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=4f31fb7962a241c13251994c8659595fa2e0693e
Submitter: Jenkins
Branch: master

commit 4f31fb7962a241c13251994c8659595fa2e0693e
Author: Sean McGinnis <email address hidden>
Date: Fri Nov 11 13:19:07 2016 -0600

    Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat

    If dnspython is present it causes socket.getaddrinfo() to be
    monkeypatched wiht code that does not work with IPv6. To get
    around this, the EVENTLET_NO_GREENDNS environment variable
    must be set before importing eventlet.

    This is resolved in the eventlet upstream code [1], but has not
    yet been released. Once our requirements have been raised past
    the 0.19.0 release with a version that includes this change we
    can remove this workaround.

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

    Change-Id: Id9fe265d67f6e9ea5090bebcacae4a7a9150c5c2
    Closes-bug: #1471049

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/397372

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 10.0.0.0b1

This issue was fixed in the openstack/cinder 10.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/newton)

Reviewed: https://review.openstack.org/397372
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ed91915a4e217e519eeb2c0e3de14e9e73c3b002
Submitter: Jenkins
Branch: stable/newton

commit ed91915a4e217e519eeb2c0e3de14e9e73c3b002
Author: Sean McGinnis <email address hidden>
Date: Fri Nov 11 13:19:07 2016 -0600

    Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat

    If dnspython is present it causes socket.getaddrinfo() to be
    monkeypatched wiht code that does not work with IPv6. To get
    around this, the EVENTLET_NO_GREENDNS environment variable
    must be set before importing eventlet.

    This is resolved in the eventlet upstream code [1], but has not
    yet been released. Once our requirements have been raised past
    the 0.19.0 release with a version that includes this change we
    can remove this workaround.

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

    Change-Id: Id9fe265d67f6e9ea5090bebcacae4a7a9150c5c2
    Closes-bug: #1471049
    (cherry picked from commit 4f31fb7962a241c13251994c8659595fa2e0693e)
    Conflicts:
     cinder/__init__.py

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 9.1.1

This issue was fixed in the openstack/cinder 9.1.1 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers