invalid PCI alias in flavor results in HTTP 500 on instance create

Bug #1818701 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chris Friesen
Pike
Confirmed
Medium
Unassigned
Queens
Confirmed
Medium
Unassigned
Rocky
Fix Committed
Medium
Matt Riedemann

Bug Description

If an invalid PCI alias is specified in the flavor extra-specs and we try to create an instance with that flavor, it will result in a PciInvalidAlias exception being raised.

In ServersController.create() PciInvalidAlias is missing from the list of exceptions that get converted to an HTTPBadRequest. Instead, it's reported as a 500 error:

[stack@fedora-1 nova]$ nova boot --flavor ds2G --image fedora29 --nic none --admin-pass fedora asdf3
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'nova.exception.PciInvalidAlias'> (HTTP 500) (Request-ID: req-fec3face-4135-41fd-bc48-07957363ddae)

Tags: api pci
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/641082

Changed in nova:
assignee: nobody → Chris Friesen (cbf123)
status: New → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :
Download full text (5.2 KiB)

Logs:

Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi [None req-fec3face-4135-41fd-bc48-07957363ddae demo admin] Unexpected exception in API method: PciInvalidAlias: Inva>
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi Traceback (most recent call last):
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 671, in wrapped
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return f(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/validation/__init__.py", line 110, in wrapper
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
Mar 05 16:19:03 fedora-1.novalocal <email address hidden>[26557]: ERROR nova.api.openstack.wsgi File "/opt/stack/nova/...

Read more...

tags: added: pci
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit cb5ad6d3c14caccfc2b222dc5d2f1f6c5e05da9c
Author: Chris Friesen <email address hidden>
Date: Tue Mar 5 09:53:37 2019 -0600

    Handle missing exception in instance creation code

    In the instance creation code path it's possible for the PciInvalidAlias
    exception to be raised if the flavor extra-specs have an invalid PCI
    alias. This should be converted to HTTPBadRequest along with the other
    exceptions stemming from invalid extra-specs.

    Without this, it gets reported as an HTTP 500 error.

    Change-Id: Ia6921b5cd9253f65ff6904bdbce942759633de95
    Closes-Bug: #1818701
    Signed-off-by: Chris Friesen <email address hidden>

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/641401

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

Reviewed: https://review.openstack.org/641401
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=50cc1e8bb6fd31a86295aedcec83d49e4d4d52eb
Submitter: Zuul
Branch: stable/rocky

commit 50cc1e8bb6fd31a86295aedcec83d49e4d4d52eb
Author: Chris Friesen <email address hidden>
Date: Tue Mar 5 09:53:37 2019 -0600

    Handle missing exception in instance creation code

    In the instance creation code path it's possible for the PciInvalidAlias
    exception to be raised if the flavor extra-specs have an invalid PCI
    alias. This should be converted to HTTPBadRequest along with the other
    exceptions stemming from invalid extra-specs.

    Without this, it gets reported as an HTTP 500 error.

    Change-Id: Ia6921b5cd9253f65ff6904bdbce942759633de95
    Closes-Bug: #1818701
    Signed-off-by: Chris Friesen <email address hidden>
    (cherry picked from commit cb5ad6d3c14caccfc2b222dc5d2f1f6c5e05da9c)

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.

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

This issue was fixed in the openstack/nova 18.2.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.