500 error returned from server GET by numeric id

Bug #1522536 reported by melanie witt
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Sean Dague

Bug Description

When a request is made for example:

GET http://10.0.2.15:8774/v2.1/6d1693dacc4749e5937e93cc70a24aa9/servers/1

and there exists an instance in the database with id primary key of 1, a 500 error is returned to the user. This was noticed during investigation of an issue [1] in novaclient. The scenario happens if a user names their instance as "1" and there exists an instance with id 1 in the database, and they do 'nova show 1'. This traces [2] in nova-api.log.

All of the code in nova api assumes it's receiving an instance uuid from the client, so even though it retrieves an instance from the database by numeric id, it fails at the api caching layer (i.e. cache_db_instance) because it adds the cache entry by uuid. When another extension tries to retrieve the instance from the cache by numeric id, it returns None.

[1] https://bugs.launchpad.net/python-novaclient/+bug/1516924
[2] http://paste.openstack.org/show/480694/

Tags: api
Changed in nova:
assignee: nobody → Sriteja (sriteja-alapati)
Zhihai Song (szhsong)
Changed in nova:
status: New → Confirmed
Revision history for this message
Sean Dague (sdague) wrote :

This is a 500 error, we really should address this before Mitaka.

Changed in nova:
importance: Undecided → High
Revision history for this message
Zhihai Song (szhsong) wrote :

@Sriteja if you have no plan to work on this bug, I would like to take over.

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

Changed in nova:
assignee: Sriteja (sriteja-alapati) → Zhihai Song (szhsong)
status: Confirmed → In Progress
Changed in nova:
assignee: Zhihai Song (szhsong) → Sean Dague (sdague)
Revision history for this message
Pawel Koniszewski (pawel-koniszewski) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/282012

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

Change abandoned by Zhihai Song (<email address hidden>) on branch: master
Review: https://review.openstack.org/281091

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

Reviewed: https://review.openstack.org/281277
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=021ff842285fa3c85c67a20595a70ce039fbeb2c
Submitter: Jenkins
Branch: master

commit 021ff842285fa3c85c67a20595a70ce039fbeb2c
Author: Sean Dague <email address hidden>
Date: Wed Feb 17 08:39:11 2016 -0500

    Remove support for integer ids in compute_api.get

    Because of the in tree ec2 api we used to need to easily handle both
    integer and uuid ids as if they were the same thing. This led to
    making compute_api.get take either and try to do the right thing. This
    unfortunately meant we exposed the indexed integer ids over the
    OpenStack API, which was never intended.

    ... and turns out to totally explode because of the way we cache
    requests for extensions to post process them. The hide_address
    extension shows a nice bit of exploding which has been noticed by our
    users.

    Remove the int id facility. Remove the test for it. Update the other
    tests that were sneaking in and using id==1 like very naughty folks
    (there will be coal in your stocking this year).

    Closes-Bug: #1522536

    Change-Id: Ibff4cebe71714ac9c470337c2ee5f57df4343829

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

Reviewed: https://review.openstack.org/282012
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5fe04c2ee8b721ecdaea4d06de54b4998a0df395
Submitter: Jenkins
Branch: master

commit 5fe04c2ee8b721ecdaea4d06de54b4998a0df395
Author: Sean Dague <email address hidden>
Date: Thu Feb 18 14:12:41 2016 -0500

    add a place for functional test to block specific regressions

    We get some bugs reported in by users which we can replicate and fix
    most easily in a full stack way. Having a dedicated place to put these
    seems like a good idea. They are in no way an attempt to test all the
    things, they are specific tests that demonstrate a bug, and ensure
    that once that particular bug is fixed, it will not come back.

    Change-Id: Idfd8680133197beabaf6e1ac8df7490c2a345b17
    Related-Bug: #1522536

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.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.