various md-* create and update api's return 500 error if 4 bytes unicode characters is passed

Bug #1570789 reported by Bhagyashri Shewale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Bhagyashri Shewale

Bug Description

md-* create and update apis are returning 500 error when you pass 4 bytes unicode characters in the request.

Steps to reproduce:

$ glance md-object-create --schema '{}' --name 🚓 <namespace>

or

$ curl -g -i -X POST http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6" -d '{"name": "\ud83d\ude93"}'

Result:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 595, in main
    args.func(client, args)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 898, in do_md_tag_update
    **fields)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", line 461, in update
    self.http_client.put(url, data=tag)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 185, in put
    return self.request(url, 'PUT', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 332, in request
    return self._handle_response(resp)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 83, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPInternalServerError: 500 Internal Server Error: The server has either erred or is incapable of
performing the requested operation. (HTTP 500) 500 Internal Server Error: The server has either erred or is
incapable of performing the requested operation. (HTTP 500)

List of APIs failing:

1. md-namespace-create
2. md-namespace-update
3. md-property-create
4. md-property-update
5. md-object-create
6. md-object-update
7. md-tag-create
8. md-tag-update

Changed in glance:
assignee: nobody → Bhagyashri Shewale (bhagyashri-shewale)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/306424

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/306424
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=6e10f1b4c90e444c8978e4b3cfe650dc0fc810fc
Submitter: Jenkins
Branch: master

commit 6e10f1b4c90e444c8978e4b3cfe650dc0fc810fc
Author: bhagyashris <email address hidden>
Date: Thu Mar 24 10:01:59 2016 +0000

    Return BadRequest for 4 byte unicode characters

    Various create and update apis are returning 500 error
    when you pass 4 byte unicode characters in the request.

    This patch fixes the issue to return HTTP 400 Bad Request.

    1. md-namespace-create
    2. md-namespace-update
    3. md-property-create
    4. md-property-update
    5. md-object-create
    6. md-object-update
    7. md-tag-create
    8. md-tag-update

    APIImpact: For all of the above APIs, it will return 400 error instead
    of 500 if user passes 4 byte unicode characters in the request.

    Closes-Bug: #1570789
    Change-Id: I8233cf95310aa2671ebc62995c58208024fc38a3

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/glance 13.0.0.0b1

This issue was fixed in the openstack/glance 13.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.