Activity log for bug #1514325

Date Who What changed Old value New value Message
2015-11-09 07:16:43 Liang Chen bug added bug
2015-11-09 07:16:49 Liang Chen oslo.versionedobjects: assignee Liang Chen (cbjchen)
2015-11-09 07:18:52 Liang Chen description The following error is reported when creating a volume snapshot with non-ascii display-description, e.g. cinder snapshot-create --display-description "中文" my-2nd-volume. 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher [req-81f48a02-b1ef-4aae-9e22-ac2ce1c75b2f 16818cbff07548889da69bf526558d97 7aac0111a39741f59513c05b2d83dd70 - - -] Exception during message handling: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last): 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback)) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/osprofiler/profiler.py", line 102, in wrapper 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher info["function"]["kwargs"] = str(kwargs) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher UnicodeEncodeError: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Root cause is that profiler tries to get a string representation of the arguments (cinder.objects.snapshot.Snapshot) of the snapshot create cinder volume service api. As a result, VersionedObject.__repr__ will be called to produce such a string representation with an attribute (display-description) containing non-ascii characters, thus returning an unicode object. However when __repr__ returns an unicode object, it's expected that the the returned string can be encoded by default encoding scheme which is ascii in general [1][2]. So __repr__ needs to make sure any unicode string it's going to return are properly encoded. [1] trying to encode the returned string when it's an unicode object https://github.com/python/cpython/blob/2.7/Objects/object.c#L387 [2] if encoding arg is left null, default encoding will be used https://github.com/python/cpython/blob/2.7/Objects/unicodeobject.c#L1355 The following error is reported when creating a volume snapshot with non-ascii display-description, e.g. cinder snapshot-create --display-description "中文" my-2nd-volume. 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher [req-81f48a02-b1ef-4aae-9e22-ac2ce1c75b2f 16818cbff07548889da69bf526558d97 7aac0111a39741f59513c05b2d83dd70 - - -] Exception during message handling: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last): 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback)) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/osprofiler/profiler.py", line 102, in wrapper 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher info["function"]["kwargs"] = str(kwargs) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher UnicodeEncodeError: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Root cause is that profiler tries to get a string representation of the arguments (cinder.objects.snapshot.Snapshot) of the snapshot-create cinder-volume service api. As a result, VersionedObject.__repr__ is called to produce such a string representation with an attribute (display-description) containing non-ascii characters, thus returning an unicode object. However when __repr__ returns an unicode object, it's expected that the the returned string can be encoded by default encoding scheme which is ascii in general [1][2]. So __repr__ needs to make sure any unicode string it's going to return are properly encoded. [1] trying to encode the returned string when it's an unicode object https://github.com/python/cpython/blob/2.7/Objects/object.c#L387 [2] if encoding arg is left null, default encoding will be used https://github.com/python/cpython/blob/2.7/Objects/unicodeobject.c#L1355
2015-11-09 07:57:51 Nobuto Murata bug added subscriber Nobuto Murata
2015-11-09 15:23:33 Liang Chen oslo.versionedobjects: status New In Progress
2015-11-10 07:05:57 Liang Chen oslo.versionedobjects: status In Progress Fix Committed
2015-11-10 10:32:50 Liang Chen tags sts
2015-11-16 20:24:06 Davanum Srinivas (DIMS) oslo.versionedobjects: status Fix Committed Fix Released
2015-11-16 20:24:06 Davanum Srinivas (DIMS) oslo.versionedobjects: milestone 0.13.0
2015-11-18 06:38:38 Liang Chen bug task added cinder
2015-11-18 06:39:31 Liang Chen cinder: assignee Liang Chen (cbjchen)
2015-11-18 06:39:44 Liang Chen cinder: status New In Progress
2015-12-25 06:25:30 Liang Chen description The following error is reported when creating a volume snapshot with non-ascii display-description, e.g. cinder snapshot-create --display-description "中文" my-2nd-volume. 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher [req-81f48a02-b1ef-4aae-9e22-ac2ce1c75b2f 16818cbff07548889da69bf526558d97 7aac0111a39741f59513c05b2d83dd70 - - -] Exception during message handling: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last): 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback)) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/osprofiler/profiler.py", line 102, in wrapper 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher info["function"]["kwargs"] = str(kwargs) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher UnicodeEncodeError: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Root cause is that profiler tries to get a string representation of the arguments (cinder.objects.snapshot.Snapshot) of the snapshot-create cinder-volume service api. As a result, VersionedObject.__repr__ is called to produce such a string representation with an attribute (display-description) containing non-ascii characters, thus returning an unicode object. However when __repr__ returns an unicode object, it's expected that the the returned string can be encoded by default encoding scheme which is ascii in general [1][2]. So __repr__ needs to make sure any unicode string it's going to return are properly encoded. [1] trying to encode the returned string when it's an unicode object https://github.com/python/cpython/blob/2.7/Objects/object.c#L387 [2] if encoding arg is left null, default encoding will be used https://github.com/python/cpython/blob/2.7/Objects/unicodeobject.c#L1355 [Impact] * Cinder snapshot display-description cannot contain non-ascii characters. [Test Case] * cinder create 1 * cinder snapshot-create --display-description "中文" <the volume ID> [Regression Potential] * None The following error is reported when creating a volume snapshot with non-ascii display-description, e.g. cinder snapshot-create --display-description "中文" my-2nd-volume. 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher [req-81f48a02-b1ef-4aae-9e22-ac2ce1c75b2f 16818cbff07548889da69bf526558d97 7aac0111a39741f59513c05b2d83dd70 - - -] Exception during message handling: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last): 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback)) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher executor_callback) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/osprofiler/profiler.py", line 102, in wrapper 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher info["function"]["kwargs"] = str(kwargs) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher UnicodeEncodeError: 'ascii' codec can't encode characters in position 111-117: ordinal not in range(128) 2015-11-09 05:55:50.995 29937 ERROR oslo_messaging.rpc.dispatcher Root cause is that profiler tries to get a string representation of the arguments (cinder.objects.snapshot.Snapshot) of the snapshot-create cinder-volume service api. As a result, VersionedObject.__repr__ is called to produce such a string representation with an attribute (display-description) containing non-ascii characters, thus returning an unicode object. However when __repr__ returns an unicode object, it's expected that the the returned string can be encoded by default encoding scheme which is ascii in general [1][2]. So __repr__ needs to make sure any unicode string it's going to return are properly encoded. [1] trying to encode the returned string when it's an unicode object https://github.com/python/cpython/blob/2.7/Objects/object.c#L387 [2] if encoding arg is left null, default encoding will be used https://github.com/python/cpython/blob/2.7/Objects/unicodeobject.c#L1355
2015-12-25 06:25:59 Liang Chen bug task added cinder (Ubuntu)
2015-12-25 06:26:24 Liang Chen cinder (Ubuntu): status New In Progress
2015-12-25 06:26:27 Liang Chen cinder (Ubuntu): assignee Liang Chen (cbjchen)
2015-12-25 06:32:29 Liang Chen branch linked lp:~cbjchen/cinder/lp1514325
2015-12-31 17:08:56 Mathew Hodson cinder (Ubuntu): importance Undecided Medium
2016-03-29 03:31:11 GuoChang Tang bug added subscriber GuoChang Tang
2016-04-07 07:58:08 Dong Liu bug added subscriber Dong Liu
2016-06-28 08:37:32 FanChao bug added subscriber FanChao
2016-09-08 11:13:51 James Page cinder (Ubuntu): status In Progress Fix Released
2016-09-13 19:18:59 Matt Riedemann cinder: status In Progress Invalid