Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1383899 - Can not create cinder snapshot if the description contains non-ascii code
Can not create cinder snapshot if the description contains non-ascii code
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder (Show other bugs)
8.0 (Liberty)
Unspecified Unspecified
unspecified Severity medium
: async
: 8.0 (Liberty)
Assigned To: Eric Harney
lkuchlan
: Triaged, ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-12 02:09 EDT by Chen
Modified: 2017-12-04 00:52 EST (History)
5 users (show)

See Also:
Fixed In Version: openstack-cinder-7.0.2-5.el7ost
Doc Type: Bug Fix
Doc Text:
There is a known issue with Unicode string handling in the OSProfiler library. Consequently, the creation of a Block Storage (cinder) snapshot will fail if it uses non-ascii characters. With this update, the OSProfiler library is not loaded unless it is specifically enabled in the cinder configuration. As a result, the Unicode handling issue in OSProfiler is still present, and will result in the same failure if OSProfiler is used, however it will be unlikely to occur in most cinder configurations. A more in-depth resolution for this issue is not currently in scope.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-21 11:42:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
lkuchlan: automate_bug+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2991 normal SHIPPED_LIVE Moderate: openstack-cinder, openstack-glance, and openstack-nova update 2016-12-21 16:34:31 EST

  None (edit)
Description Chen 2016-10-12 02:09:58 EDT
Description of problem:

Can not create cinder snapshot if the description contains non-ascii code

Version-Release number of selected component (if applicable):

OSP8 


How reproducible:

100%

Steps to Reproduce:
1. Create a cinder volume
2. Create a snapshot based on that volume and fill in the description using some Japanese words
3.

Actual results:

2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher [req-aac877ea-3042-4db9-a45b-15153903317c 2ca1a257e7e348aa9e21162c74e0691b 60593a55518a41168555751afb3cb97e - - -] Exception during message handling: 'ascii' codec can't encode characters in position 111-113: ordinal not in range(128)
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher     executor_callback))
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher     executor_callback)
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher     result = func(ctxt, **new_args)
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 102, in wrapper
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher     info["function"]["kwargs"] = str(kwargs)
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher UnicodeEncodeError: 'ascii' codec can't encode characters in position 111-113: ordinal not in range(128)
2016-10-12 01:26:50.191 27761 ERROR oslo_messaging.rpc.dispatcher


Expected results:


Additional info:
Comment 1 Eric Harney 2016-10-12 13:05:35 EDT
The backport here should resolve this issue, but the issue will still occur if osprofiler has been enabled for cinder by setting [profiler] profiler_enabled=True in cinder.conf.
Comment 2 Eric Harney 2016-10-12 13:17:08 EDT
Reproduces with:

# cinder create 1
# cinder snapshot-create --description 角  <id>
Comment 3 Chen 2016-10-12 21:31:50 EDT
Hi Eric,

Sorry for a general question: we do support the non-ascii characters for the resource names and description in OSP, am I right ? So if there is something wrong with encode/decode for other components I should also file bugzilla right ?

Best Regards,
Chen
Comment 4 Eric Harney 2016-10-13 09:49:22 EDT
(In reply to Chen from comment #3)
> Sorry for a general question: we do support the non-ascii characters for the
> resource names and description in OSP, am I right ? So if there is something
> wrong with encode/decode for other components I should also file bugzilla
> right ?
> 

Yes, anywhere this fails should be considered a bug.

Thanks,
Eric
Comment 9 lkuchlan 2016-12-06 04:50:33 EST
Tested using:
openstack-cinder-7.0.3-1.el7ost.noarch

Verification flow:

[stack@undercloud-0 ~]$ cinder create 1
+---------------------------------------+--------------------------------------+
|                Property               |                Value                 |
+---------------------------------------+--------------------------------------+
|              attachments              |                  []                  |
|           availability_zone           |                 nova                 |
|                bootable               |                false                 |
|          consistencygroup_id          |                 None                 |
|               created_at              |      2016-12-06T09:46:02.000000      |
|              description              |                 None                 |
|               encrypted               |                False                 |
|                   id                  | 6c05b8b6-f154-4610-9ec2-2235e97ebe03 |
|                metadata               |                  {}                  |
|            migration_status           |                 None                 |
|              multiattach              |                False                 |
|                  name                 |                 None                 |
|         os-vol-host-attr:host         |                 None                 |
|     os-vol-mig-status-attr:migstat    |                 None                 |
|     os-vol-mig-status-attr:name_id    |                 None                 |
|      os-vol-tenant-attr:tenant_id     |   3ad530b2f760496eb7865912ebc3b83b   |
|   os-volume-replication:driver_data   |                 None                 |
| os-volume-replication:extended_status |                 None                 |
|           replication_status          |               disabled               |
|                  size                 |                  1                   |
|              snapshot_id              |                 None                 |
|              source_volid             |                 None                 |
|                 status                |               creating               |
|                user_id                |   7acdf736904e4e0fa208119399a21319   |
|              volume_type              |                 None                 |
+---------------------------------------+--------------------------------------+

[stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+------------------+------+------+-------------+----------+-------------+-------------+
|                  ID                  |   Status  | Migration Status | Name | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+------------------+------+------+-------------+----------+-------------+-------------+
| 6c05b8b6-f154-4610-9ec2-2235e97ebe03 | available |        -         |  -   |  1   |      -      |  false   |    False    |             |
+--------------------------------------+-----------+------------------+------+------+-------------+----------+-------------+-------------+

[stack@undercloud-0 ~]$ cinder snapshot-create 6c05b8b6-f154-4610-9ec2-2235e97ebe03 --description 角スナップショ 
+-------------+--------------------------------------+
|   Property  |                Value                 |
+-------------+--------------------------------------+
|  created_at |      2016-12-06T09:47:01.408544      |
| description |            角スナップショ            |
|      id     | c09a52f0-84a4-48af-b90a-d79c074ff8e9 |
|   metadata  |                  {}                  |
|     name    |                 None                 |
|     size    |                  1                   |
|    status   |               creating               |
|  volume_id  | 6c05b8b6-f154-4610-9ec2-2235e97ebe03 |
+-------------+--------------------------------------+

[stack@undercloud-0 ~]$ cinder snapshot-list
+--------------------------------------+--------------------------------------+-----------+------+------+
|                  ID                  |              Volume ID               |   Status  | Name | Size |
+--------------------------------------+--------------------------------------+-----------+------+------+
| c09a52f0-84a4-48af-b90a-d79c074ff8e9 | 6c05b8b6-f154-4610-9ec2-2235e97ebe03 | available |  -   |  1   |
+--------------------------------------+--------------------------------------+-----------+------+------+

[stack@undercloud-0 ~]$ cinder snapshot-show c09a52f0-84a4-48af-b90a-d79c074ff8e9
+--------------------------------------------+--------------------------------------+
|                  Property                  |                Value                 |
+--------------------------------------------+--------------------------------------+
|                 created_at                 |      2016-12-06T09:47:01.000000      |
|                description                 |            角スナップショ            |
|                     id                     | c09a52f0-84a4-48af-b90a-d79c074ff8e9 |
|                  metadata                  |                  {}                  |
|                    name                    |                 None                 |
|  os-extended-snapshot-attributes:progress  |                 100%                 |
| os-extended-snapshot-attributes:project_id |   3ad530b2f760496eb7865912ebc3b83b   |
|                    size                    |                  1                   |
|                   status                   |              available               |
|                 volume_id                  | 6c05b8b6-f154-4610-9ec2-2235e97ebe03 |
+--------------------------------------------+--------------------------------------+
Comment 11 errata-xmlrpc 2016-12-21 11:42:02 EST
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.

https://rhn.redhat.com/errata/RHSA-2016-2991.html

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