Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 965139 - Exception on running glance commands with non-ASCII arguments
Exception on running glance commands with non-ASCII arguments
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance (Show other bugs)
2.1
Unspecified Unspecified
medium Severity medium
: rc
: 3.0
Assigned To: Flavio Percoco
Daniel Paikov
: Triaged
Depends On:
Blocks: 975487
  Show dependency treegraph
 
Reported: 2013-05-20 09:46 EDT by Daniel Paikov
Modified: 2016-04-27 01:05 EDT (History)
5 users (show)

See Also:
Fixed In Version: openstack-glance-2013.1-5.el6ost
Doc Type: Bug Fix
Doc Text:
Previously, running Glance commands such as “glance image-show” followed by non-ASCII arguments would cause an error. This has been fixed so that Unicode characters are also managed correctly.
Story Points: ---
Clone Of:
: 975487 (view as bug list)
Environment:
Last Closed: 2013-06-27 13:15:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
fpercoco: internal‑review+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1182824 None None None Never
OpenStack gerrit 30112 None None None Never
Red Hat Product Errata RHBA-2013:0968 normal SHIPPED_LIVE Red Hat OpenStack 3.0 ("Grizzly") bug fix and enhancement update 2013-06-27 17:14:27 EDT

  None (edit)
Description Daniel Paikov 2013-05-20 09:46:27 EDT
Running commands such as glance image-show/image-download/image-update/image-delete with non-ASCII arguments produces the following exception:

[root@gold-vdsc ~(keystone_admin)]$ glance image-delete כדגכגדש
Request returned failure status.
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/eventlet/wsgi.py", line 382, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.6/site-packages/keystone/middleware/auth_token.py", line 293, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.6/site-packages/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.6/site-packages/Routes-1.12.3-py2.6.egg/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 533, in __call__
    request, **action_args)
  File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 550, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/api/v1/images.py", line 203, in detail
    images = registry.get_images_detail(req.context, **params)
  File "/usr/lib/python2.6/site-packages/glance/registry/__init__.py", line 128, in get_images_detail
    return c.get_images_detailed(**kwargs)
  File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 113, in get_images_detailed
    res = self.do_request("GET", "/images/detail", params=params)
  File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 89, in do_request
    action, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 63, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 442, in do_request
    url = self._construct_url(action, params)
  File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 458, in _construct_url
    query = urllib.urlencode(params)
  File "/usr/lib64/python2.6/urllib.py", line 1281, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)
 (HTTP 500)
Comment 2 Eoghan Glynn 2013-06-11 08:04:26 EDT
Already built in brew:

  https://brewweb.devel.redhat.com/buildinfo?buildID=275537
Comment 5 Daniel Paikov 2013-06-18 03:24:58 EDT
openstack-glance-2013.1-5.el6ost: A long and ugly exception is now a long and ugly error:

[root@orange-vdsf tmp(keystone_admin)]# glance image-delete כשדגכשד
Traceback (most recent call last):
  File "/usr/bin/glance", line 9, in <module>
    load_entry_point('python-glanceclient==0.9.0', 'console_scripts', 'glance')()
  File "/usr/lib/python2.6/site-packages/glanceclient/shell.py", line 474, in main
    print >> sys.stderr, e
UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-37: ordinal not in range(128)


For contrast, this is how a regular non-existant image error looks like:
[root@orange-vdsf tmp(keystone_admin)]# glance image-delete fadfa
No image with a name or ID of 'fadfa' exists.
Comment 6 Flavio Percoco 2013-06-18 07:00:28 EDT
@daniel

That error you're seeing belongs to glanceclient. The issue with openstack-glance not accepting non-ascii characters is fixed. 

Could you file a new bug for it and re-verify this one? 

@stephen

Added it. Thanks for noticing.
Comment 7 Flavio Percoco 2013-06-18 07:05:08 EDT
@daniel

Let me elaborate more.

In the client side, you're getting to the point where the client received back from the server a message like:

    'No image with a name or ID of 'כשדגכשד' exists.'

The thing is the client is failing (for the same encoding reason) to print it. This issue was fixed a couple of months ago - client's one - but seems to be back...

Hope the above makes it clearer.
Comment 8 Flavio Percoco 2013-06-18 10:58:50 EDT
Needs to be re-verified. I'll file a new bug for glanceclient.
Comment 9 Daniel Paikov 2013-06-19 03:38:22 EDT
Checked on openstack-glance-2013.1-5.el6ost
Comment 11 errata-xmlrpc 2013-06-27 13:15:39 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0968.html

Note You need to log in before you can comment on or make changes to this bug.