← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1449611] [NEW] Attempting to update an image property or add an image tag with 4 byte unicode returns a 500, not a 400

 

Public bug reported:

Overview:
When attempting to reproduce an the following Launchpad bug (https://bugs.launchpad.net/glance/+bug/1370954), 4 byte unicode characters should no longer be allowed for image properties or image tags. Using the specific value of 'u'Černý'', a 500 response still appears to be returned instead of a 400 response as we should.  This could be a potential issue that regex didn't catch.

Steps to reproduce:
1) Import an image
2) Attempt to update the image name, passing in 4 byte unicode via:
curl -i /v2/images/<image_id> -X PATCH -H "Content-Type: application/openstack-images-v2.1-json-patch" -H "Accept: application/json" -H "X-Auth-Token: <token>" -d '[{"path": "/name", "value": "u'Černý'", "op": "replace"}]'
3) Notice that a 500 response is returned
4) Attempt to add an image tag, passing in 4 byte unicode via:
curl -i /v2/images/<image_id>/tags/u'Černý' -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"
5) Notice that a 500 response is returned

Expected:
A 400 response should be returned

Actual:
A 500 response is returned for both of these operations

** 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/1449611

Title:
  Attempting to update an image property or add an image tag with 4 byte
  unicode returns a 500, not a 400

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

Bug description:
  Overview:
  When attempting to reproduce an the following Launchpad bug (https://bugs.launchpad.net/glance/+bug/1370954), 4 byte unicode characters should no longer be allowed for image properties or image tags. Using the specific value of 'u'Černý'', a 500 response still appears to be returned instead of a 400 response as we should.  This could be a potential issue that regex didn't catch.

  Steps to reproduce:
  1) Import an image
  2) Attempt to update the image name, passing in 4 byte unicode via:
  curl -i /v2/images/<image_id> -X PATCH -H "Content-Type: application/openstack-images-v2.1-json-patch" -H "Accept: application/json" -H "X-Auth-Token: <token>" -d '[{"path": "/name", "value": "u'Černý'", "op": "replace"}]'
  3) Notice that a 500 response is returned
  4) Attempt to add an image tag, passing in 4 byte unicode via:
  curl -i /v2/images/<image_id>/tags/u'Černý' -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <token>"
  5) Notice that a 500 response is returned

  Expected:
  A 400 response should be returned

  Actual:
  A 500 response is returned for both of these operations

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


Follow ups

References