Filters does not support non-ASCII value

Bug #1521193 reported by Darja Shakhray
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Bhagyashri Shewale
Glance Client
Invalid
Undecided
Bhagyashri Shewale

Bug Description

Glanceclient does not encode value "--property-filter" that call 500 error on wsgi server

STEPS TO REPRODUCE:
glance --debug image-list --property-filter name=Привет

ACTUAL RESULT:
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}e2f09d062a40c2c9dd36331412527ca29c01f2c7' -H 'Content-Type: application/octet-stream' http://172.18.66.81:9292/v2/images?limit=2000&name=%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82&sort_key=name&sort_dir=asc
Request returned failure status 500.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 709, in main
    args.func(client, args)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 182, in do_image_list
    utils.print_list(images, columns)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 183, in print_list
    for o in objs:
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 176, in list
    for image in paginate(url, page_size, limit):
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 108, in paginate
    resp, body = self.http_client.get(next_url)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 280, in get
    return self._request('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 272, in _request
    resp, body_iter = self._handle_response(resp)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 93, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPInternalServerError: HTTPInternalServerError (HTTP 500)
HTTPInternalServerError (HTTP 500)

logs on glance-server:
http://paste.openstack.org/show/480358/

Changed in python-glanceclient:
assignee: nobody → Darja Shakhray (dshakhray)
description: updated
Changed in python-glanceclient:
assignee: Darja Shakhray (dshakhray) → Bhagyashri Shewale (bhagyashri-shewale)
Revision history for this message
Ian Cordasco (icordasc) wrote :

500 errors indicate bugs in the API service. This should be fixed there.

Changed in python-glanceclient:
status: New → Invalid
Changed in glance:
assignee: nobody → Bhagyashri Shewale (bhagyashri-shewale)
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/418217
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=8c3148b7e9e41b3f85169f4804975cc5b92061d7
Submitter: Jenkins
Branch: master

commit 8c3148b7e9e41b3f85169f4804975cc5b92061d7
Author: bhagyashris <email address hidden>
Date: Thu May 5 14:00:06 2016 +0000

    Fix filter doesn't support non-ascii characters

    When non-ascii characters is passed as filter parameter to "image-list"
    and "md-namespace-list" APIs then it returns HTTP 500 if glance service
    is running using Python2. This is because query parameters passed to
    the urlparse.urlencode method raises UnicodeEncodeError for non-ascii
    characters.

    Overridden params property of webob.request.BaseRequest in wsgi layer
    Request class to avoid encoding of request params at several places in
    case of Py2. Added a new class attribute 'encoded_params' which is
    initialized to encoded params dict when params property is called for
    the first time and in the subsequent calls this attribute is returned
    without requiring you to worry whether the params value are encoded
    or not.

    Closes-Bug: #1521193
    Change-Id: If4497d42820aa4b8070666d2a1a4413411557f12

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 15.0.0.0b3

This issue was fixed in the openstack/glance 15.0.0.0b3 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.