nova flavor-show <id> raises 500 error if flavor is deleted

Bug #1538896 reported by Abhishek Kekane
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Bhagyashri Shewale
Liberty
Fix Released
Undecided
Nicolas Simonds

Bug Description

Reproducible on latest master.

Tried to show deleted flavor then it raises 500 error.

Steps to reproduce:

1. Create flavor
$ nova flavor-create m2.test 10 1200 12 8

2. Delete flavor
$ nova flavor-delete 10

3. Show deleted flavor
$ nova flavor-show 10

ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. <class 'webob.exc.HTTPNotFound'> (HTTP 500) (Request-ID: req-4f77f74c-2234-4beb-9875-157364bdd964)

Nova api logs:
---------------------

 from (pid=31454) _http_log_response /usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py:254
2016-01-27 15:28:14.067 DEBUG nova.api.openstack.wsgi [req-15b4f90e-332b-4e96-b839-8cd931605e42 admin demo] Calling method '<bound method FlavorExtraSpecsController.index of <nova.api.openstack.compute.flavors_extraspecs.FlavorExtraSpecsController object at 0x7ff02f22cad0>>' from (pid=31454) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:699
2016-01-27 15:28:14.082 ERROR nova.api.openstack.extensions [req-15b4f90e-332b-4e96-b839-8cd931605e42 admin demo] Unexpected exception in API method
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 478, in wrapped
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/flavors_extraspecs.py", line 60, in index
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions return self._get_extra_specs(context, flavor_id)
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/flavors_extraspecs.py", line 39, in _get_extra_specs
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions flavor = common.get_flavor(context, flavor_id)
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/common.py", line 543, in get_flavor
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions raise exc.HTTPNotFound(explanation=error.format_message())
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions HTTPNotFound: Flavor 122 could not be found.
2016-01-27 15:28:14.082 TRACE nova.api.openstack.extensions
2016-01-27 15:28:14.085 INFO nova.api.openstack.wsgi [req-15b4f90e-332b-4e96-b839-8cd931605e42 admin demo] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'webob.exc.HTTPNotFound'>
2016-01-27 15:28:14.086 DEBUG nova.api.openstack.wsgi [req-15b4f90e-332b-4e96-b839-8cd931605e42 admin demo] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'webob.exc.HTTPNotFound'> from (pid=31454) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1070
2016-01-27 15:28:14.097 INFO nova.osapi_compute.wsgi.server [req-15b4f90e-332b-4e96-b839-8cd931605e42 admin demo] 10.69.4.177 "GET /v2.1/982e2fc081364cf889d959b27d4bd510/flavors/122/os-extra_specs HTTP/1.1" status: 500 len: 499 time: 0.1559708

Tags: api
Changed in nova:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Changed in nova:
assignee: Abhishek Kekane (abhishek-kekane) → Bhagyashri Shewale (bhagyashri-shewale)
Revision history for this message
Augustina Ragwitz (auggy) wrote :

I was able to reproduce this, stack trace pasted below from nova logs:

2016-02-04 23:49:50.052 DEBUG nova.api.openstack.wsgi [req-314f0442-98f4-4cd6-8cc1-3b75fb09ed3f admin admin] Calling method '<bound method FlavorExtraSpecsController.index of <nova.api.openstack.compute.flavors_extraspecs.FlavorExtraSpecsController object at 0x7ff5c513d690>>' from (pid=27806) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:699
2016-02-04 23:49:50.064 ERROR nova.api.openstack.extensions [req-314f0442-98f4-4cd6-8cc1-3b75fb09ed3f admin admin] Unexpected exception in API method
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 478, in wrapped
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/flavors_extraspecs.py", line 60, in index
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions return self._get_extra_specs(context, flavor_id)
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/flavors_extraspecs.py", line 39, in _get_extra_specs
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions flavor = common.get_flavor(context, flavor_id)
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/common.py", line 543, in get_flavor
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions raise exc.HTTPNotFound(explanation=error.format_message())
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions HTTPNotFound: Flavor 10 could not be found.
2016-02-04 23:49:50.064 TRACE nova.api.openstack.extensions
2016-02-04 23:49:50.065 INFO nova.api.openstack.wsgi [req-314f0442-98f4-4cd6-8cc1-3b75fb09ed3f admin admin] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'webob.exc.HTTPNotFound'>
2016-02-04 23:49:50.065 DEBUG nova.api.openstack.wsgi [req-314f0442-98f4-4cd6-8cc1-3b75fb09ed3f admin admin] Returning 500 to user: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'webob.exc.HTTPNotFound'> from (pid=27806) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1070
2016-02-04 23:49:50.066 INFO nova.osapi_compute.wsgi.server [req-314f0442-98f4-4cd6-8cc1-3b75fb09ed3f admin admin] 10.42.0.53 "GET /v2.1/9f087ae0a9784a1a925d8cc428d0b151/flavors/10/os-extra_specs HTTP/1.1" status: 500 len: 499 time: 0.1468120

Changed in nova:
status: New → Confirmed
tags: added: api
jichenjc (jichenjc)
Changed in nova:
importance: Undecided → Low
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/279413

Changed in nova:
status: Confirmed → In Progress
Sean Dague (sdague)
Changed in nova:
importance: Low → High
milestone: none → mitaka-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/279413
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4184f985011ddcca08ae695bb9793794037a0b04
Submitter: Jenkins
Branch: master

commit 4184f985011ddcca08ae695bb9793794037a0b04
Author: bhagyashris <email address hidden>
Date: Thu Feb 4 01:21:49 2016 -0800

    Fix 500 error for showing deleted flavor details

    Displaying deleted flavor details throws 500 internal server error.
    Added 404 HttpNotFound status code in "@extension.expected_errors".

    APIImpact: Return 404 status code for list extra specs
    for a deleted flavor.

    Closes-Bug: #1538896

    Change-Id: Iba33296c28c3c3d6ba60052fe434107ac9c00c61

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 13.0.0.0b3

This issue was fixed in the openstack/nova 13.0.0.0b3 development milestone.

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/343109

Revision history for this message
Fu Guang Ping (fuguangping) wrote :

Why can we get the deleted flavor, but fail to get its extra-specs?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/liberty)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/343109
Reason: Sorry, gonna have to carry this out of tree for liberty, we're locking down for liberty-eol.

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.