← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1413205] [NEW] RBD backend errors are not raised correctly

 

Public bug reported:

glance_store 2014.2
When operation on RBD backend fail, e.g. by trying to open missing image in RBD pool, glance_store tries to raise exception NotFound with incorrect argument list, so glance API returns Internal Server Error 500.
Older version (2014.1) returns 404.

Steps to reproduce:
$ glance image-create --name test --disk-format qcow2 --container-format bare --copy-from http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-i386-disk.img
# rbd -p images snap unprotect dbedacd2-a140-4816-a96d-b98ef610ddc3@snap
# rbd -p images snap rm dbedacd2-a140-4816-a96d-b98ef610ddc3@snap
# rbd -p images rm dbedacd2-a140-4816-a96d-b98ef610ddc3
# glance-cache-manage -f delete-all-cached-images # only if cache used
$ glance image-download --file img dbedacd2-a140-4816-a96d-b98ef610ddc3
HTTPInternalServerError (HTTP 500)

Backtrace in log:
  File "/usr/lib/python2.7/dist-packages/glance/api/v1/images.py", line 454, in _get_from_store
    image_data, image_size = src_store.get(loc, context=context)
  File "/usr/lib/python2.7/dist-packages/glance_store/_drivers/rbd.py", line 222, in get
    chunk_size or self.get_size(location))
  File "/usr/lib/python2.7/dist-packages/glance_store/_drivers/rbd.py", line 248, in get_size
    raise exceptions.NotFound(msg)
TypeError: __init__() takes exactly 1 argument (2 given)

Request log attached.

** Affects: glance
     Importance: Undecided
         Status: New

** Attachment added: "Request log"
   https://bugs.launchpad.net/bugs/1413205/+attachment/4302962/+files/glance-TypeError.txt

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

Title:
  RBD backend errors are not raised correctly

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

Bug description:
  glance_store 2014.2
  When operation on RBD backend fail, e.g. by trying to open missing image in RBD pool, glance_store tries to raise exception NotFound with incorrect argument list, so glance API returns Internal Server Error 500.
  Older version (2014.1) returns 404.

  Steps to reproduce:
  $ glance image-create --name test --disk-format qcow2 --container-format bare --copy-from http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-i386-disk.img
  # rbd -p images snap unprotect dbedacd2-a140-4816-a96d-b98ef610ddc3@snap
  # rbd -p images snap rm dbedacd2-a140-4816-a96d-b98ef610ddc3@snap
  # rbd -p images rm dbedacd2-a140-4816-a96d-b98ef610ddc3
  # glance-cache-manage -f delete-all-cached-images # only if cache used
  $ glance image-download --file img dbedacd2-a140-4816-a96d-b98ef610ddc3
  HTTPInternalServerError (HTTP 500)

  Backtrace in log:
    File "/usr/lib/python2.7/dist-packages/glance/api/v1/images.py", line 454, in _get_from_store
      image_data, image_size = src_store.get(loc, context=context)
    File "/usr/lib/python2.7/dist-packages/glance_store/_drivers/rbd.py", line 222, in get
      chunk_size or self.get_size(location))
    File "/usr/lib/python2.7/dist-packages/glance_store/_drivers/rbd.py", line 248, in get_size
      raise exceptions.NotFound(msg)
  TypeError: __init__() takes exactly 1 argument (2 given)

  Request log attached.

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


Follow ups

References