ObjectStore must throw 404 when bucket does not exist (Commit 146)

Bug #607541 reported by justinsb
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
justinsb

Bug Description

Before the twisted rewrite of the objectstore, if a bucket did not exist, Bucket::__init__ would throw exception.NotFound(), and then the @catch_nova_exceptions annotation would wrap that as a 404. Now I think the exception is not being caught, and it is simply being thrown as a 500.

The problem is that e.g. euca-upload-bundle checks to see if a bucket should be created before upload by doing a GET on the bucket and looking for a 404. This logic now fails.

Essentially, the logic in catch_nova_exceptions has been lost. I presume NotAuthorized is thrown somewhere also, and should also be caught and wrapped.

def catch_nova_exceptions(target):
     # FIXME: find a way to wrap all handlers in the web.Application.__init__ ?
     def wrapper(*args, **kwargs):
         try:
             return target(*args, **kwargs)
         except exception.NotFound:
             raise web.HTTPError(404)
         except exception.NotAuthorized:
             raise web.HTTPError(403)

     return wrapper

Related branches

Revision history for this message
Jay Pipes (jaypipes) wrote :

setting to High since this breaks the prior API.

Changed in nova:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → justinsb (justin-fathomdb)
Revision history for this message
justinsb (justin-fathomdb) wrote :

Jay - is the 'Needs Fixing' because of the unattributed TODO? I've now changed that to "TODO(unassigned) (calling-all-twisted-experts)", which I believe is the protocol is nobody wants it. If you really want someone on it, maybe soren could be persuaded as he did the twisted rewrite in the first place?

The TODO doesn't stop the fix working, it just could be cleaner. I think we should get this merged in as-is, because it breaks the ability for new people to get compute running.

Revision history for this message
Jay Pipes (jaypipes) wrote :

No, the TODO is because there was no test case for either the bug or the fix :) Also, please keep review commentary on the merge proposal :)

Eric Day (eday)
Changed in nova:
status: Fix Committed → Fix Released
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.