← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1733551] [NEW] Stage call returns 500 internal server error when image does not exists

 

Public bug reported:

If user tries to stage data to unexisting image then it fails with 500
internal server error.

Ideally it should return 404 HTTNotFound error to the user.

Steps to reproduce:

1. Run image-stage with any random id command
   $ glance image-stage abcd --file <file_name>

Output:
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

Glance API logs:

Nov 21 10:12:29 devstack devstack@g-api.service[19195]: pdict['tenant'] = self.tenant
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data [None req-99abd47d-7c74-43ad-a92e-abf01d97f4c4 admin admin] Failed to stage image data due to internal error: ImageNotFound: No image found with ID abcd
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data Traceback (most recent call last):
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/v2/image_data.py", line 298, in stage
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = image_repo.get(image_id)
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/authorization.py", line 107, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = self.image_repo.get(image_id)
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/policy.py", line 105, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = super(ImageRepoProxy, self).get(image_id)
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/db/__init__.py", line 89, in get
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     raise exception.ImageNotFound(msg)
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data ImageNotFound: No image found with ID abcd
Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data

** Affects: glance
     Importance: Undecided
     Assignee: Abhishek Kekane (abhishek-kekane)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => Abhishek Kekane (abhishek-kekane)

** Description changed:

  If user tries to stage data to unexisting image then it fails with 500
  internal server error.
  
  Ideally it should return 404 HTTNotFound error to the user.
  
  Steps to reproduce:
  
  1. Run image-stage with any random id command
-    $ glance image-stage abcd1234 --file <file_name>
+    $ glance image-stage abcd --file <file_name>
  
  Output:
  500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)
  
  Glance API logs:
  
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: pdict['tenant'] = self.tenant
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data [None req-99abd47d-7c74-43ad-a92e-abf01d97f4c4 admin admin] Failed to stage image data due to internal error: ImageNotFound: No image found with ID abcd
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data Traceback (most recent call last):
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/v2/image_data.py", line 298, in stage
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = image_repo.get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/authorization.py", line 107, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = self.image_repo.get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/policy.py", line 105, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = super(ImageRepoProxy, self).get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/db/__init__.py", line 89, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     raise exception.ImageNotFound(msg)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data ImageNotFound: No image found with ID abcd
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data

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

Title:
  Stage call returns 500 internal server error when image does not
  exists

Status in Glance:
  New

Bug description:
  If user tries to stage data to unexisting image then it fails with 500
  internal server error.

  Ideally it should return 404 HTTNotFound error to the user.

  Steps to reproduce:

  1. Run image-stage with any random id command
     $ glance image-stage abcd --file <file_name>

  Output:
  500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

  Glance API logs:

  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: pdict['tenant'] = self.tenant
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data [None req-99abd47d-7c74-43ad-a92e-abf01d97f4c4 admin admin] Failed to stage image data due to internal error: ImageNotFound: No image found with ID abcd
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data Traceback (most recent call last):
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/v2/image_data.py", line 298, in stage
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = image_repo.get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/authorization.py", line 107, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = self.image_repo.get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/api/policy.py", line 105, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     image = super(ImageRepoProxy, self).get(image_id)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/domain/proxy.py", line 86, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     return self.helper.proxy(self.base.get(item_id))
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data   File "/opt/stack/glance/glance/db/__init__.py", line 89, in get
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data     raise exception.ImageNotFound(msg)
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data ImageNotFound: No image found with ID abcd
  Nov 21 10:12:29 devstack devstack@g-api.service[19195]: ERROR glance.api.v2.image_data

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


Follow ups