← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1260314] [NEW] glance image-create with invalid store fails but still creates image

 

Public bug reported:

glance checks whether or not a specified store is valid, but if it is
invalid the image has already been created.

I pulled the latest  devstack code and then ran these commands after
sourcing openrc:

ubuntu@devstack-glance:/mnt/devstack$ glance index
ID                                   Name                           Disk Format          Container Format     Size          
------------------------------------ ------------------------------ -------------------- -------------------- --------------
6792e9a7-f4f8-48cb-b407-80e360b8a773 cirros-0.3.1-x86_64-uec        ami                  ami                        25165824
7808c034-3fdd-4975-af26-e7d5a15d2113 cirros-0.3.1-x86_64-uec-ramdis ari                  ari                         3714968
4efcddb2-9f20-413f-86a3-3bf69455e09b cirros-0.3.1-x86_64-uec-kernel aki                  aki                         4955792
ubuntu@devstack-glance:/mnt/devstack$ 
ubuntu@devstack-glance:/mnt/devstack$ glance -d image-create --store s3e --disk-format raw --container-format bare --name complete_gibberish </etc/hosts
curl -i -X POST -H 'x-image-meta-container_format: bare' -H 'Transfer-Encoding: chunked' -H 'x-image-meta-store: s3e' -H 'User-Agent: python-glanceclient' -H 'x-image-meta-size: 221' -H 'x-image-meta-is_public: False' -H 'X-Auth-Token: <redacted_token>' -H 'Content-Type: application/octet-stream' -H 'x-image-meta-disk_format: raw' -H 'x-image-meta-name: complete_gibberish' -d '<open file '<stdin>', mode 'r' at 0x7f16181b6150>' http://10.4.36.1:9292/v1/images

HTTP/1.1 400 Bad Request
date: Thu, 12 Dec 2013 12:47:37 GMT
content-length: 52
content-type: text/plain; charset=UTF-8
x-openstack-request-id: req-c9bad6ee-d79c-41f3-bd96-d3929afd742c

400 Bad Request

Store for scheme s3e not found


Request returned failure status.
400 Bad Request
Store for scheme s3e not found
    (HTTP 400)
ubuntu@devstack-glance:/mnt/devstack$ glance index
ID                                   Name                           Disk Format          Container Format     Size          
------------------------------------ ------------------------------ -------------------- -------------------- --------------
b26c03e4-7cdf-44fe-9187-7de315c9b38b complete_gibberish             raw                  bare                            221
6792e9a7-f4f8-48cb-b407-80e360b8a773 cirros-0.3.1-x86_64-uec        ami                  ami                        25165824
7808c034-3fdd-4975-af26-e7d5a15d2113 cirros-0.3.1-x86_64-uec-ramdis ari                  ari                         3714968
4efcddb2-9f20-413f-86a3-3bf69455e09b cirros-0.3.1-x86_64-uec-kernel aki                  aki                         4955792

This problem occurs using the v1 API. If using the V2 API the '--store'
option does not seem to be present.

** Affects: glance
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1260314

Title:
  glance image-create with invalid store fails but still creates image

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  glance checks whether or not a specified store is valid, but if it is
  invalid the image has already been created.

  I pulled the latest  devstack code and then ran these commands after
  sourcing openrc:

  ubuntu@devstack-glance:/mnt/devstack$ glance index
  ID                                   Name                           Disk Format          Container Format     Size          
  ------------------------------------ ------------------------------ -------------------- -------------------- --------------
  6792e9a7-f4f8-48cb-b407-80e360b8a773 cirros-0.3.1-x86_64-uec        ami                  ami                        25165824
  7808c034-3fdd-4975-af26-e7d5a15d2113 cirros-0.3.1-x86_64-uec-ramdis ari                  ari                         3714968
  4efcddb2-9f20-413f-86a3-3bf69455e09b cirros-0.3.1-x86_64-uec-kernel aki                  aki                         4955792
  ubuntu@devstack-glance:/mnt/devstack$ 
  ubuntu@devstack-glance:/mnt/devstack$ glance -d image-create --store s3e --disk-format raw --container-format bare --name complete_gibberish </etc/hosts
  curl -i -X POST -H 'x-image-meta-container_format: bare' -H 'Transfer-Encoding: chunked' -H 'x-image-meta-store: s3e' -H 'User-Agent: python-glanceclient' -H 'x-image-meta-size: 221' -H 'x-image-meta-is_public: False' -H 'X-Auth-Token: <redacted_token>' -H 'Content-Type: application/octet-stream' -H 'x-image-meta-disk_format: raw' -H 'x-image-meta-name: complete_gibberish' -d '<open file '<stdin>', mode 'r' at 0x7f16181b6150>' http://10.4.36.1:9292/v1/images

  HTTP/1.1 400 Bad Request
  date: Thu, 12 Dec 2013 12:47:37 GMT
  content-length: 52
  content-type: text/plain; charset=UTF-8
  x-openstack-request-id: req-c9bad6ee-d79c-41f3-bd96-d3929afd742c

  400 Bad Request

  Store for scheme s3e not found


  Request returned failure status.
  400 Bad Request
  Store for scheme s3e not found
      (HTTP 400)
  ubuntu@devstack-glance:/mnt/devstack$ glance index
  ID                                   Name                           Disk Format          Container Format     Size          
  ------------------------------------ ------------------------------ -------------------- -------------------- --------------
  b26c03e4-7cdf-44fe-9187-7de315c9b38b complete_gibberish             raw                  bare                            221
  6792e9a7-f4f8-48cb-b407-80e360b8a773 cirros-0.3.1-x86_64-uec        ami                  ami                        25165824
  7808c034-3fdd-4975-af26-e7d5a15d2113 cirros-0.3.1-x86_64-uec-ramdis ari                  ari                         3714968
  4efcddb2-9f20-413f-86a3-3bf69455e09b cirros-0.3.1-x86_64-uec-kernel aki                  aki                         4955792

  This problem occurs using the v1 API. If using the V2 API the '--
  store' option does not seem to be present.

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


Follow ups

References