Non-templated transport_url will fail if not defined in config

Bug #1798158 reported by Dan Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Smith
Rocky
Fix Committed
Medium
Surya Seetharaman

Bug Description

If transport_url is not defined in the config, we will fail to format a non-templated transport_url in the database like this:

ERROR nova.objects.cell_mapping [None req-34831485-adf4-4a0d-bb20-e1736d93a451 None None] Failed to parse [DEFAULT]/transport_url to format cell mapping: AttributeError: 'NoneType' object has no attribute 'find'
ERROR nova.objects.cell_mapping Traceback (most recent call last):
ERROR nova.objects.cell_mapping File "/opt/stack/nova/nova/objects/cell_mapping.py", line 150, in _format_mq_url
ERROR nova.objects.cell_mapping return CellMapping._format_url(url, CONF.transport_url)
ERROR nova.objects.cell_mapping File "/opt/stack/nova/nova/objects/cell_mapping.py", line 101, in _format_url
ERROR nova.objects.cell_mapping default_url = urlparse.urlparse(default)
ERROR nova.objects.cell_mapping File "/usr/lib/python2.7/urlparse.py", line 143, in urlparse
ERROR nova.objects.cell_mapping tuple = urlsplit(url, scheme, allow_fragments)
ERROR nova.objects.cell_mapping File "/usr/lib/python2.7/urlparse.py", line 182, in urlsplit
ERROR nova.objects.cell_mapping i = url.find(':')
ERROR nova.objects.cell_mapping AttributeError: 'NoneType' object has no attribute 'find'
ERROR nova.objects.cell_mapping

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

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

Changed in nova:
assignee: nobody → Dan Smith (danms)
status: New → In Progress
Dan Smith (danms)
tags: added: rocky-backport-potential
Changed in nova:
importance: Undecided → Medium
Matt Riedemann (mriedem)
tags: added: cells
Changed in nova:
assignee: Dan Smith (danms) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Matt Riedemann (mriedem) → Dan Smith (danms)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/611094
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=133d6b3bcc26bb2e66ef303011280e38add00702
Submitter: Zuul
Branch: master

commit 133d6b3bcc26bb2e66ef303011280e38add00702
Author: Dan Smith <email address hidden>
Date: Tue Oct 16 09:58:29 2018 -0700

    Fix formatting non-templated cell URLs with no config

    If transport_url or connection are unset in config, we will fail to format
    even non-templated cell mapping URLs due to an overly specific check in the
    format routines. This fixes it by always bailing on templating if the config
    is unset, and keeping the error message if we were unable to format a
    template as a result.

    Change-Id: I760580b8e6594be2bee99a5b825a690b07ab9deb
    Closes-Bug: #1798158

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

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/611327

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

Reviewed: https://review.openstack.org/611327
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=44e12db8420da9cea8cb23f3b0fabed2d1e0278b
Submitter: Zuul
Branch: stable/rocky

commit 44e12db8420da9cea8cb23f3b0fabed2d1e0278b
Author: Dan Smith <email address hidden>
Date: Tue Oct 16 09:58:29 2018 -0700

    Fix formatting non-templated cell URLs with no config

    If transport_url or connection are unset in config, we will fail to format
    even non-templated cell mapping URLs due to an overly specific check in the
    format routines. This fixes it by always bailing on templating if the config
    is unset, and keeping the error message if we were unable to format a
    template as a result.

    Change-Id: I760580b8e6594be2bee99a5b825a690b07ab9deb
    Closes-Bug: #1798158
    (cherry picked from commit 133d6b3bcc26bb2e66ef303011280e38add00702)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.3

This issue was fixed in the openstack/nova 18.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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.