__str__ causes a UnicodeError

Bug #1461521 reported by Tobias Urdin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.i18n
Invalid
Undecided
Unassigned

Bug Description

Hello,
I have upgraded my OpenStack deployment from Juno to Kilo, the following issue was found.

The packages I have.
[root@controller1 ~]# rpm -qa | grep -i cinder
openstack-cinder-2015.1.0-2.el7.noarch
python-cinder-2015.1.0-2.el7.noarch
python-cinderclient-1.1.1-1.el7.centos.noarch

Here is a snippet where the problem occurs.

if six.PY2:
        def __str__(self):
            # NOTE(luisg): Logging in python 2.6 tries to str() log records,
            # and it expects specifically a UnicodeError in order to proceed.
            from oslo_i18n._i18n import _
            msg = _('Message objects do not support str() because they may '
                    'contain non-ascii characters. '
                    'Please use unicode() or translate() instead.')
            raise UnicodeError(msg)

Issue is here: /usr/lib/python2.7/site-packages/oslo_i18n/_message.py", line 167, in __str__
UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

From log file /var/log/cinder/cinder-volume-usage-audit.log
2015-06-03 14:00:01.483 7521 CRITICAL cinder [req-d73048bd-77d4-4c67-a772-5e3fab39f057 - - - - -] UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.
2015-06-03 14:00:01.483 7521 TRACE cinder Traceback (most recent call last):
2015-06-03 14:00:01.483 7521 TRACE cinder File "/bin/cinder-volume-usage-audit", line 10, in <module>
2015-06-03 14:00:01.483 7521 TRACE cinder sys.exit(main())
2015-06-03 14:00:01.483 7521 TRACE cinder File "/usr/lib/python2.7/site-packages/cinder/cmd/volume_usage_audit.py", line 98, in main
2015-06-03 14:00:01.483 7521 TRACE cinder print(_("Starting volume usage audit"))
2015-06-03 14:00:01.483 7521 TRACE cinder File "/usr/lib/python2.7/site-packages/oslo_i18n/_message.py", line 167, in __str__
2015-06-03 14:00:01.483 7521 TRACE cinder raise UnicodeError(msg)
2015-06-03 14:00:01.483 7521 TRACE cinder UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.
2015-06-03 14:00:01.483 7521 TRACE cinder

What would be causing this issue?
I have disable cinder v1 API in the configuration and also changed all the endpoints to use v2.

Best regards

Revision history for this message
Tobias Urdin (tobias-urdin) wrote :

Maybe this should be reported to Cinder? My bad.

Changed in oslo.i18n:
status: New → Invalid
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.