Images in 'killed' status show in index(); no status shown in show()

Bug #768969 reported by Édouard Thuleau on 2011-04-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Medium
Jay Pipes

Bug Description

I use Glance bzr123 configured with Swift backend.
I made a mistake in my Swift configuration and I tried to add file to datastore.

$ glance add name="Jonas" is_public=True disk_format=qcow2 container_format=bare < /media/nas/OpenStack/Jonas_16022011_2.qcow2
Failed to add image. Got error:
400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

 Error uploading image: Auth GET failed: https://p-hs21-15-swift-proxy-1:11000/v1.0/glance 401 Unauthorized
$ glance index
Found 1 public images...
ID Name Disk Format Container Format Size
---------------- ------------------------------ -------------------- -------------------- --------------
1 Jonas qcow2 bare 0
root@p-novamaster:~# glance show 1
URI: http://0.0.0.0/images/1
Id: 1
Public: Yes
Name: Jonas
Size: 0
Location: None
Disk format: qcow2
Container format: bare

The glance add command returns an error 400. That's normal but the image was still registry in the database.

2011-04-22 15:05:50 DEBUG [routes.middleware] Matched POST /images
2011-04-22 15:05:50 DEBUG [routes.middleware] Route path: '/images', defaults: {'action': u'create', 'controller': <glance.server.Controller object at 0x202f310>}
2011-04-22 15:05:50 DEBUG [routes.middleware] Match dict: {'action': u'create', 'controller': <glance.server.Controller object at 0x202f310>}
2011-04-22 15:05:50 DEBUG [glance.registry] Adding image metadata...
2011-04-22 15:05:50 DEBUG [glance.registry] container_format: bare
2011-04-22 15:05:50 DEBUG [glance.registry] disk_format: qcow2
2011-04-22 15:05:50 DEBUG [glance.registry] is_public: True
2011-04-22 15:05:50 DEBUG [glance.registry] name: Jonas
2011-04-22 15:05:50 DEBUG [glance.registry] size: 0
2011-04-22 15:05:50 DEBUG [glance.registry] status: queued
2011-04-22 15:05:50 DEBUG [routes.middleware] Matched POST /images
2011-04-22 15:05:50 DEBUG [routes.middleware] Route path: '/images', defaults: {'action': u'create', 'controller': <glance.registry.server.Controller object at 0x32c5510>}
2011-04-22 15:05:50 DEBUG [routes.middleware] Match dict: {'action': u'create', 'controller': <glance.registry.server.Controller object at 0x32c5510>}
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] BEGIN
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] INSERT INTO images (created_at, updated_at, deleted_at, deleted, name, disk_format, container_format, size, status, is_public, location, checksum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (datetime.datetime(2011, 4, 22, 13, 5, 50, 398241), None, None, False, u'Jonas', u'qcow2', u'bare', 0, u'queued', True, None, None)
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT image_properties.created_at AS image_properties_created_at, image_properties.updated_at AS image_properties_updated_at, image_properties.deleted_at AS image_properties_deleted_at, image_properties.deleted AS image_properties_deleted, image_properties.id AS image_properties_id, image_properties.image_id AS image_properties_image_id, image_properties.name AS image_properties_name, image_properties.value AS image_properties_value
FROM image_properties
WHERE %s = image_properties.image_id
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (1L,)
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('image_properties_created_at', 'image_properties_updated_at', 'image_properties_deleted_at', 'image_properties_deleted', 'image_properties_id', 'image_properties_image_id', 'image_properties_name', 'image_properties_value')
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] COMMIT
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value
FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id
WHERE images.deleted = %s AND images.id = %s
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (False, 1L)
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('images_created_at', 'images_updated_at', 'images_deleted_at', 'images_deleted', 'images_id', 'images_name', 'images_disk_format', 'images_container_format', 'images_size', 'images_status', 'images_is_public', 'images_location', 'images_checksum', 'image_properties_1_created_at', 'image_properties_1_updated_at', 'image_properties_1_deleted_at', 'image_properties_1_deleted', 'image_properties_1_id', 'image_properties_1_image_id', 'image_properties_1_name', 'image_properties_1_value')
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Row (datetime.datetime(2011, 4, 22, 13, 5, 50), None, None, 0, 1L, 'Jonas', 'qcow2', 'bare', 0L, 'queued', 1, None, None, None, None, None, None, None, None, None, None)
2011-04-22 15:05:50 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [22/Apr/2011 15:05:50] "POST /images HTTP/1.1" 200 405 0.039658
2011-04-22 15:05:50 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.add_image():
2011-04-22 15:05:50 DEBUG [glance.registry] checksum: None
2011-04-22 15:05:50 DEBUG [glance.registry] container_format: bare
2011-04-22 15:05:50 DEBUG [glance.registry] created_at: 2011-04-22T13:05:50
2011-04-22 15:05:50 DEBUG [glance.registry] deleted: False
2011-04-22 15:05:50 DEBUG [glance.registry] deleted_at: None
2011-04-22 15:05:50 DEBUG [glance.registry] disk_format: qcow2
2011-04-22 15:05:50 DEBUG [glance.registry] id: 1
2011-04-22 15:05:50 DEBUG [glance.registry] is_public: True
2011-04-22 15:05:50 DEBUG [glance.registry] location: None
2011-04-22 15:05:50 DEBUG [glance.registry] name: Jonas
2011-04-22 15:05:50 DEBUG [glance.registry] size: 0
2011-04-22 15:05:50 DEBUG [glance.registry] status: queued
2011-04-22 15:05:50 DEBUG [glance.registry] updated_at: None
2011-04-22 15:05:50 DEBUG [glance.server] Setting image 1 to status 'saving'
2011-04-22 15:05:50 DEBUG [glance.registry] Updating image metadata for image 1...
2011-04-22 15:05:50 DEBUG [glance.registry] status: saving
2011-04-22 15:05:50 DEBUG [routes.middleware] Matched PUT /images/1
2011-04-22 15:05:50 DEBUG [routes.middleware] Route path: '/images/:(id)', defaults: {'action': u'update', 'controller': <glance.registry.server.Controller object at 0x32c5510>}
2011-04-22 15:05:50 DEBUG [routes.middleware] Match dict: {'action': u'update', 'controller': <glance.registry.server.Controller object at 0x32c5510>, 'id': u'1'}
2011-04-22 15:05:50 DEBUG [glance.registry.server] Updating image 1 with metadata: {u'status': u'saving'}
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] BEGIN
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value
FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id
WHERE images.deleted = %s AND images.id = %s
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (False, '1')
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('images_created_at', 'images_updated_at', 'images_deleted_at', 'images_deleted', 'images_id', 'images_name', 'images_disk_format', 'images_container_format', 'images_size', 'images_status', 'images_is_public', 'images_location', 'images_checksum', 'image_properties_1_created_at', 'image_properties_1_updated_at', 'image_properties_1_deleted_at', 'image_properties_1_deleted', 'image_properties_1_id', 'image_properties_1_image_id', 'image_properties_1_name', 'image_properties_1_value')
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Row (datetime.datetime(2011, 4, 22, 13, 5, 50), None, None, 0, 1L, 'Jonas', 'qcow2', 'bare', 0L, 'queued', 1, None, None, None, None, None, None, None, None, None, None)
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] UPDATE images SET updated_at=%s, status=%s WHERE images.id = %s
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (datetime.datetime(2011, 4, 22, 13, 5, 50, 585033), u'saving', 1L)
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] COMMIT
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value
FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id
WHERE images.deleted = %s AND images.id = %s
2011-04-22 15:05:50 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (False, 1L)
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('images_created_at', 'images_updated_at', 'images_deleted_at', 'images_deleted', 'images_id', 'images_name', 'images_disk_format', 'images_container_format', 'images_size', 'images_status', 'images_is_public', 'images_location', 'images_checksum', 'image_properties_1_created_at', 'image_properties_1_updated_at', 'image_properties_1_deleted_at', 'image_properties_1_deleted', 'image_properties_1_id', 'image_properties_1_image_id', 'image_properties_1_name', 'image_properties_1_value')
2011-04-22 15:05:50 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Row (datetime.datetime(2011, 4, 22, 13, 5, 50), datetime.datetime(2011, 4, 22, 13, 5, 50), None, 0, 1L, 'Jonas', 'qcow2', 'bare', 0L, 'saving', 1, None, None, None, None, None, None, None, None, None, None)
2011-04-22 15:05:50 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [22/Apr/2011 15:05:50] "PUT /images/1 HTTP/1.1" 200 422 0.047647
2011-04-22 15:05:50 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.update_image():
2011-04-22 15:05:50 DEBUG [glance.registry] checksum: None
2011-04-22 15:05:50 DEBUG [glance.registry] container_format: bare
2011-04-22 15:05:50 DEBUG [glance.registry] created_at: 2011-04-22T13:05:50
2011-04-22 15:05:50 DEBUG [glance.registry] deleted: False
2011-04-22 15:05:50 DEBUG [glance.registry] deleted_at: None
2011-04-22 15:05:50 DEBUG [glance.registry] disk_format: qcow2
2011-04-22 15:05:50 DEBUG [glance.registry] id: 1
2011-04-22 15:05:50 DEBUG [glance.registry] is_public: True
2011-04-22 15:05:50 DEBUG [glance.registry] location: None
2011-04-22 15:05:50 DEBUG [glance.registry] name: Jonas
2011-04-22 15:05:50 DEBUG [glance.registry] size: 0
2011-04-22 15:05:50 DEBUG [glance.registry] status: saving
2011-04-22 15:05:50 DEBUG [glance.registry] updated_at: 2011-04-22T13:05:50
2011-04-22 15:05:50 DEBUG [glance.server] Uploading image data for image 1 to swift store
2011-04-22 15:05:51 DEBUG [glance.store.swift] Adding image object to Swift using (auth_address=p-hs21-15-swift-proxy-1:11000/v1.0/glance, user=ethuleau, key=nah2eeBo)
2011-04-22 15:05:52 ERROR [glance.server] Error uploading image: Auth GET failed: https://p-hs21-15-swift-proxy-1:11000/v1.0/glance 401 Unauthorized
2011-04-22 15:05:52 DEBUG [glance.registry] Updating image metadata for image 1...
2011-04-22 15:05:52 DEBUG [glance.registry] status: killed
2011-04-22 15:05:52 DEBUG [routes.middleware] Matched PUT /images/1
2011-04-22 15:05:52 DEBUG [routes.middleware] Route path: '/images/:(id)', defaults: {'action': u'update', 'controller': <glance.registry.server.Controller object at 0x32c5510>}
2011-04-22 15:05:52 DEBUG [routes.middleware] Match dict: {'action': u'update', 'controller': <glance.registry.server.Controller object at 0x32c5510>, 'id': u'1'}
2011-04-22 15:05:52 DEBUG [glance.registry.server] Updating image 1 with metadata: {u'status': u'killed'}
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] BEGIN
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value
FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id
WHERE images.deleted = %s AND images.id = %s
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (False, '1')
2011-04-22 15:05:52 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('images_created_at', 'images_updated_at', 'images_deleted_at', 'images_deleted', 'images_id', 'images_name', 'images_disk_format', 'images_container_format', 'images_size', 'images_status', 'images_is_public', 'images_location', 'images_checksum', 'image_properties_1_created_at', 'image_properties_1_updated_at', 'image_properties_1_deleted_at', 'image_properties_1_deleted', 'image_properties_1_id', 'image_properties_1_image_id', 'image_properties_1_name', 'image_properties_1_value')
2011-04-22 15:05:52 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Row (datetime.datetime(2011, 4, 22, 13, 5, 50), datetime.datetime(2011, 4, 22, 13, 5, 50), None, 0, 1L, 'Jonas', 'qcow2', 'bare', 0L, 'saving', 1, None, None, None, None, None, None, None, None, None, None)
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] UPDATE images SET updated_at=%s, status=%s WHERE images.id = %s
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (datetime.datetime(2011, 4, 22, 13, 5, 52, 87523), u'killed', 1L)
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] COMMIT
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, image_properties_1.created_at AS image_properties_1_created_at, image_properties_1.updated_at AS image_properties_1_updated_at, image_properties_1.deleted_at AS image_properties_1_deleted_at, image_properties_1.deleted AS image_properties_1_deleted, image_properties_1.id AS image_properties_1_id, image_properties_1.image_id AS image_properties_1_image_id, image_properties_1.name AS image_properties_1_name, image_properties_1.value AS image_properties_1_value
FROM images LEFT OUTER JOIN image_properties AS image_properties_1 ON images.id = image_properties_1.image_id
WHERE images.deleted = %s AND images.id = %s
2011-04-22 15:05:52 INFO [sqlalchemy.engine.base.Engine.0x...12d0] (False, 1L)
2011-04-22 15:05:52 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Col ('images_created_at', 'images_updated_at', 'images_deleted_at', 'images_deleted', 'images_id', 'images_name', 'images_disk_format', 'images_container_format', 'images_size', 'images_status', 'images_is_public', 'images_location', 'images_checksum', 'image_properties_1_created_at', 'image_properties_1_updated_at', 'image_properties_1_deleted_at', 'image_properties_1_deleted', 'image_properties_1_id', 'image_properties_1_image_id', 'image_properties_1_name', 'image_properties_1_value')
2011-04-22 15:05:52 DEBUG [sqlalchemy.engine.base.Engine.0x...12d0] Row (datetime.datetime(2011, 4, 22, 13, 5, 50), datetime.datetime(2011, 4, 22, 13, 5, 52), None, 0, 1L, 'Jonas', 'qcow2', 'bare', 0L, 'killed', 1, None, None, None, None, None, None, None, None, None, None)
2011-04-22 15:05:52 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [22/Apr/2011 15:05:52] "PUT /images/1 HTTP/1.1" 200 422 0.118508
2011-04-22 15:05:52 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.update_image():
2011-04-22 15:05:52 DEBUG [glance.registry] checksum: None
2011-04-22 15:05:52 DEBUG [glance.registry] container_format: bare
2011-04-22 15:05:52 DEBUG [glance.registry] created_at: 2011-04-22T13:05:50
2011-04-22 15:05:52 DEBUG [glance.registry] deleted: False
2011-04-22 15:05:52 DEBUG [glance.registry] deleted_at: None
2011-04-22 15:05:52 DEBUG [glance.registry] disk_format: qcow2
2011-04-22 15:05:52 DEBUG [glance.registry] id: 1
2011-04-22 15:05:52 DEBUG [glance.registry] is_public: True
2011-04-22 15:05:52 DEBUG [glance.registry] location: None
2011-04-22 15:05:52 DEBUG [glance.registry] name: Jonas
2011-04-22 15:05:52 DEBUG [glance.registry] size: 0
2011-04-22 15:05:52 DEBUG [glance.registry] status: killed
2011-04-22 15:05:52 DEBUG [glance.registry] updated_at: 2011-04-22T13:05:52
2011-04-22 15:06:19 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [22/Apr/2011 15:06:19] "POST /images HTTP/1.1" 400 352 29.517682

Related branches

Jay Pipes (jaypipes) wrote :

OK, so looks like this bug has two parts:

1) Public images in a killed status are shown on calls to glance index and glance detail, and they should not be
2) An image's status does not seem to be shown in glance show <ID> and it should be.

Would you agree with the above statements, Edoaurd?

Jay Pipes (jaypipes) on 2011-04-22
summary: - Upload in Swift backend fails but image is register
+ Images in 'killed' status show in index(); no status shown in show()
Changed in glance:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Jay Pipes (jaypipes)
Changed in glance:
status: In Progress → Fix Committed
Édouard Thuleau (ethuleau) wrote :

Hi Jay,

Sorry to answer so late, it was a day off yesterday in France.
I'm agree with your analyse. I'll test yous fix.

Thanks,
Édouard.

Thierry Carrez (ttx) on 2011-06-02
Changed in glance:
milestone: none → diablo-1
Thierry Carrez (ttx) on 2011-09-22
Changed in glance:
milestone: diablo-1 → 2011.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers