Bug 1383899 - Can not create cinder snapshot if the description contains non-ascii code
Summary: Can not create cinder snapshot if the description contains non-ascii code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 8.0 (Liberty)
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: async
: 8.0 (Liberty)
Assignee: Eric Harney
QA Contact: lkuchlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-12 06:09 UTC by Chen
Modified: 2022-07-09 07:56 UTC (History)
7 users (show)

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.
Clone Of:
Environment:
Last Closed: 2016-12-21 16:42:02 UTC
Target Upstream Version:
Embargoed:
lkuchlan: automate_bug+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-14100 0 None None None 2022-03-22 06:43:34 UTC
Red Hat Product Errata RHSA-2016:2991 0 normal SHIPPED_LIVE Moderate: openstack-cinder, openstack-glance, and openstack-nova update 2016-12-21 21:34:31 UTC

Description Chen 2016-10-12 06:09:58 UTC
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 17:05:35 UTC
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 17:17:08 UTC
Reproduces with:

# cinder create 1
# cinder snapshot-create --description 角  <id>

Comment 3 Chen 2016-10-13 01:31:50 UTC
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 13:49:22 UTC
(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 09:50:33 UTC
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 16:42:02 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.

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

Comment 13 Sneha Rai 2022-03-22 06:39:11 UTC
Hi,

I'm getting the same error in my RHOSP 16.2.

[root@overcloud-controller-0 /]# rpm -qa|grep openstack-cinder
openstack-cinder-15.6.1-2.20210528143333.el8ost.3.noarch
[root@overcloud-controller-0 /]#


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