cannot delete image with status='deleted' and deleted=0

Bug #1452788 reported by Salvo Davide Rapisarda on 2015-05-07
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Undecided
Unassigned

Bug Description

Hi,

in my OpenStack Juno I have created a snapshot that gone into status='deleted' after creation.
When I try to delete this image I got a 404 "Image not found " and I cannot delete image in no way.

In "images" table DB the record fields are:

*************************** 1. row ***************************
              id: 5c79d539-f256-422c-b376-4c27c1d06b96
            name: my_image
            size: 901840896
          status: deleted
       is_public: 0
      created_at: 2015-05-07 15:24:45
      updated_at: 2015-05-07 15:25:18
      deleted_at: NULL
         deleted: 0
     disk_format: qcow2
container_format: bare
        checksum: 4483088a8840fa463d518085ae515b7b
           owner: fdd21cc5a7b144b8920cc815ab8ea2a9
        min_disk: 1
         min_ram: 0
       protected: 0
    virtual_size: NULL

For replicate this issue, I have created an image and I have change the status (via mysql UPDATE) from "active" to "deleted".

UPDATE images SET status='deleted' WHERE id = '5c79d539-f256-422c-b376-4c27c1d06b96';

and if I run:

# glance image-delete 5c79d539-f256-422c-b376-4c27c1d06b96

result is:

<html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  Image 5c79d539-f256-422c-b376-4c27c1d06b96 not found.<br /><br />

 </body>
</html> (HTTP 404): Unable to delete image 5c79d539-f256-422c-b376-4c27c1d06b96

Ritesh Paiboina (rsritesh) wrote :

Hi,
When you try to take a snapshot , is the snapshot fails to create and then it goes to delete stated ?

If you are able to see the deleted snapshot in the glance image list , then glance image-delete should works.

If you can't see your deleted snapshot in the list, then if you try to delete that , glance will show Image not found.

Changed in glance:
assignee: nobody → Ritesh (rsritesh)
Ritesh Paiboina (rsritesh) wrote :

Hi,
It would be nice, if you could tell us . How your snapshot went to delete status after creation.

Changed in glance:
assignee: Ritesh (rsritesh) → nobody
status: New → Incomplete
Chris Buccella (chris-buccella) wrote :

I've come across a deployment in this state as well: the image shows in "deleted" state in the image-list, and is not deletable by image-delete. It is not existent in the backend (RBD).

Regardless of how it came to be in this state, "not found" is not a very useful error (since the user can see it in the image list and examine the image info).

Changed in glance:
assignee: nobody → Dharini Chandrasekar (dharini-chandrasekar)
Changed in glance:
assignee: Dharini Chandrasekar (dharini-chandrasekar) → nobody
Giondo (giondo) wrote :

any solution to this or we are still in dark ages where we can't delete a image?

Connecting to the DB and deleting the record or change the status to Deleted is the worst thing you can do

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

Other bug subscribers