When creating a volume with non-English character,the log has UnicodeEncodeError

Bug #1223128 reported by Chen Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Chen Xiao

Bug Description

When creating a volume with non-English characters, and then

# cinder create --display-name ソ十豹竹敷 1
# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 23ff5a1e-b0f6-43ae-a43a-f1dc05ea48dd | available | ソ十豹竹敷 | 1 | None | False | |
| 4fe9d005-aea7-42da-9949-7a2a02ca69ef | creating | ソ十豹竹敷 | 1 | None | False | |
| 6b7a9348-7187-4752-86b3-640aba279854 | available | ソ十豹竹敷 | 1 | None | False | |
| f0020c87-1667-4497-8976-e0aec8b86453 | available | ソ十豹竹敷 | 1 | None | False | |
| f4cf2a1e-e085-4922-bdca-8c1de9cee1e2 | available | ソ十豹竹敷 | 1 | None | False | |
| f6849d8a-c7af-4a91-961c-9d68de1d8e79 | available | ソ十豹竹敷 | 1 | None | False | |
| f94da0f4-1e6a-44de-ac0c-a669fe147f51 | creating | ソ十豹竹敷 | 1 | None | False | |

 vi /var/log/cinder/volume.log
2013-09-09 21:09:25.989 7544 ERROR cinder.taskflow.utils [-] Failed rolling back 4: volume:create#cinder.volume.flows.create_volume.OnFailureRescheduleTask==1.0 due to inner exception.
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils Traceback (most recent call last):
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils File "/usr/lib/python2.6/site-packages/cinder/taskflow/utils.py", line 353, in rollback
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils f(cause)
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils File "/usr/lib/python2.6/site-packages/cinder/taskflow/utils.py", line 186, in __call__
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils self.task.revert(self.context, self.result, cause)
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils File "/usr/lib/python2.6/site-packages/cinder/volume/flows/create_volume.py", line 962, in revert
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils self._reschedule(context, cause, **result)
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils File "/usr/lib/python2.6/site-packages/cinder/volume/flows/create_volume.py", line 898, in _reschedule
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils 'num': num_attempts, 'reason': unicode(cause.exc)})
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-8: ordinal not in range(128)
2013-09-09 21:09:25.989 7544 TRACE cinder.taskflow.utils

Revision history for this message
Chen Xiao (chenxiao) wrote :

I will fix the bug

Chen Xiao (chenxiao)
Changed in cinder:
status: New → In Progress
Eric Harney (eharney)
Changed in cinder:
milestone: none → havana-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/46012

Changed in cinder:
assignee: nobody → Chen Xiao (chenxiao)
Revision history for this message
Chen Xiao (chenxiao) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/46012
Committed: http://github.com/openstack/cinder/commit/b3e8cb5b4236c39126d445c7645aed2922ab3991
Submitter: Jenkins
Branch: master

commit b3e8cb5b4236c39126d445c7645aed2922ab3991
Author: Xiao Chen <email address hidden>
Date: Wed Sep 11 14:37:16 2013 +0800

    Fixing UnicodeEncodeError against volume creating function

    When creating a volume with non-English characters and there is
    not enough space for it, then an UnicodeEncodeError occurs. So
    we need convert any coded exception message to unicode string
    for logging.

    Fixes bug 1223128

    Change-Id: If1d4faad2bcde696f20565deb01226de33caccad

Changed in cinder:
status: In Progress → Fix Committed
Changed in cinder:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.