← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1522536] Re: 500 error returned from server GET by numeric id

 

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 <sean@xxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1522536

Title:
  500 error returned from server GET by numeric id

Status in OpenStack Compute (nova):
  Fix Released

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/

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1522536/+subscriptions


References