← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1526641] [NEW] Invalid metadata value to location-add causing 500 Internal Server Error

 

Public bug reported:

Passing invalid metadata value to location-add or location-update
command raises 500 Internal Server Error.

1.	glance location-add <image-id> --url http://10.69.4.136:8111/run_tests.sh --metadata '{"a":1234}'
or
2.	glance location-update <image-id> --url http://10.69.4.136:8111/run_tests.sh --metadata '{"a":1234}'

Stacktrace on g-api:
 
2015-12-15 03:47:49.876 ERROR glance.common.wsgi [req-3a349a22-8b69-40bf-93f1-6388eb5cb4ee 6c9c7376e75b4e37ab3c052a911731dd d1ee7fd5dcc341c3973f19f790238e63] Caught error: The image metadata key a has an invalid type of <type 'int'>. Only dict, list, and unicode are supported.
2015-12-15 03:47:49.876 TRACE glance.common.wsgi Traceback (most recent call last):2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 882, in __call__
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     request, **action_args)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 911, in dispatch
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return method(*args, **kwargs)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/utils.py", line 423, in wrapped
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return func(self, req, *args,**kwargs)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 147, in update
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     change_method(req, image, change)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 197, in _do_add
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     self._do_add_locations(image, path[1], value)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 292, in _do_add_locations
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     image.locations.insert(pos, value)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/policy.py", line 275, in _checker
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return method(*args, **kwargs)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/quota/__init__.py", line 273, in insert
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return self.locations.insert(index, object)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/location.py", line 179, in insert
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     location)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/location.py", line 91, in _check_image_location
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     store_api.check_location_metadata(location['metadata'])
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/glance_store/backend.py", line 309, in check_location_metadata
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     check_location_metadata(val[key], key=key)
2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/glance_store/backend.py", line 320, in check_location_metadata
2015-12-15 03:47:49.876 TRACE glance.common.wsgi     % dict(key=key, type=type(val)))
2015-12-15 03:47:49.876 TRACE glance.common.wsgi BackendException: The image metadata key a has an invalid type of <type 'int'>. Only dict, list, and unicode are supported.
2015-12-15 03:47:49.876 TRACE glance.common.wsgi

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

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

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

Title:
  Invalid metadata value to location-add causing 500 Internal Server
  Error

Status in Glance:
  New

Bug description:
  Passing invalid metadata value to location-add or location-update
  command raises 500 Internal Server Error.

  1.	glance location-add <image-id> --url http://10.69.4.136:8111/run_tests.sh --metadata '{"a":1234}'
  or
  2.	glance location-update <image-id> --url http://10.69.4.136:8111/run_tests.sh --metadata '{"a":1234}'

  Stacktrace on g-api:
   
  2015-12-15 03:47:49.876 ERROR glance.common.wsgi [req-3a349a22-8b69-40bf-93f1-6388eb5cb4ee 6c9c7376e75b4e37ab3c052a911731dd d1ee7fd5dcc341c3973f19f790238e63] Caught error: The image metadata key a has an invalid type of <type 'int'>. Only dict, list, and unicode are supported.
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi Traceback (most recent call last):2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 882, in __call__
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     request, **action_args)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 911, in dispatch
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return method(*args, **kwargs)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/common/utils.py", line 423, in wrapped
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return func(self, req, *args,**kwargs)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 147, in update
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     change_method(req, image, change)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 197, in _do_add
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     self._do_add_locations(image, path[1], value)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/images.py", line 292, in _do_add_locations
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     image.locations.insert(pos, value)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/api/policy.py", line 275, in _checker
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return method(*args, **kwargs)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/quota/__init__.py", line 273, in insert
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     return self.locations.insert(index, object)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/location.py", line 179, in insert
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     location)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/opt/stack/glance/glance/location.py", line 91, in _check_image_location
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     store_api.check_location_metadata(location['metadata'])
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/glance_store/backend.py", line 309, in check_location_metadata
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     check_location_metadata(val[key], key=key)
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi   File "/usr/local/lib/python2.7/dist-packages/glance_store/backend.py", line 320, in check_location_metadata
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi     % dict(key=key, type=type(val)))
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi BackendException: The image metadata key a has an invalid type of <type 'int'>. Only dict, list, and unicode are supported.
  2015-12-15 03:47:49.876 TRACE glance.common.wsgi

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