Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 965139

Summary: Exception on running glance commands with non-ASCII arguments
Product: Red Hat OpenStack Reporter: Daniel Paikov <dpaikov>
Component: openstack-glanceAssignee: Flavio Percoco <fpercoco>
Status: CLOSED ERRATA QA Contact: Daniel Paikov <dpaikov>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: abaron, breeler, eglynn, fpercoco, hateya
Target Milestone: rcKeywords: Triaged
Target Release: 3.0Flags: fpercoco: internal-review+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 17:15:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 975487    

Description Daniel Paikov 2013-05-20 13:46:27 UTC
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 12:04:26 UTC
Already built in brew:

  https://brewweb.devel.redhat.com/buildinfo?buildID=275537

Comment 5 Daniel Paikov 2013-06-18 07:24:58 UTC
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 11:00:28 UTC
@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 11:05:08 UTC
@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 14:58:50 UTC
Needs to be re-verified. I'll file a new bug for glanceclient.

Comment 9 Daniel Paikov 2013-06-19 07:38:22 UTC
Checked on openstack-glance-2013.1-5.el6ost

Comment 11 errata-xmlrpc 2013-06-27 17:15:39 UTC
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