delete deleted image 500 error

Bug #1138666 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Brant Knudson

Bug Description

When you delete an image that you just deleted, you get a 500 Internal Server Error.

This can be recreated with devstack:
 1) delete an image
 2) delete the same image

Here's an example:

$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| caa6c969-0f32-466b-8e8e-a7e0ac835470 | cirros-0.3.1-x86_64-uec | ACTIVE | |
| 8af603da-b69f-49c6-8e52-25632eccb31c | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| fe67d4e1-baca-4968-8638-2314373b620b | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-1254f8a5-8dda-444a-a077-2072ab3baa6a)

If you delete a deleted image, the server should respond with some error code other than 500.
I'd suggest '403 Forbidden' since the image still exists (not sure why DELETE of a resource doesn't actually delete it, but whatever). You can still see it with nova image-show.

Brant Knudson (blk-u)
Changed in nova:
assignee: nobody → Brant Knudson (blk-u)
Changed in nova:
status: New → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :

I should note that this behavior occurs when you authenticate as an admin user. When you authenticate as a regular user (like demo), you get 404 Not Found.

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

Reviewed: https://review.openstack.org/23325
Committed: http://github.com/openstack/nova/commit/ccabf7a4dfff068bc5b37e769b7fb9d1b21cbf72
Submitter: Jenkins
Branch: master

commit ccabf7a4dfff068bc5b37e769b7fb9d1b21cbf72
Author: Brant Knudson <email address hidden>
Date: Fri Mar 1 16:27:20 2013 -0600

    delete deleted image 500 bug

    Fixes bug 1138666

    When you delete an image that you just deleted, you get a 500 Internal Server Error.
    In this case, the problem isn't an internal server error but the "unauthorized" response
    from the image service is not expected.

    This can be recreated with devstack:
     1) delete an image
     2) delete the same image

    Here's an example:

    $ nova image-list
    +--------------------------------------+---------------------------------+--------+--------+
    | ID | Name | Status | Server |
    +--------------------------------------+---------------------------------+--------+--------+
    | caa6c969-0f32-466b-8e8e-a7e0ac835470 | cirros-0.3.1-x86_64-uec | ACTIVE | |
    | 8af603da-b69f-49c6-8e52-25632eccb31c | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
    | fe67d4e1-baca-4968-8638-2314373b620b | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
    +--------------------------------------+---------------------------------+--------+--------+

    $ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470

    $ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470
    ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-1254f8a5-8dda-444a-a077-2072ab3baa6a)

    If you delete a deleted image, the server should respond with '403 Forbidden'
    because the image still exists and no user is allowed to delete a deleted image.

    The fix is to catch the exception from the image service and
    convert it to a wsgi exception for '403 Forbidden'.

    Change-Id: I2f14687d5468b67389f5dd6ab338ceb54e8a29bb

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
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.