Multiple VM creation with unicode-containing names fails

Bug #1565911 reported by Anna Babich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Status tracked in 10.0.x
10.0.x
Invalid
Medium
MOS Nova

Bug Description

It happens when creating more than one instance with unicode-containing name. The first attempt to boot an instance with unicode-containing name is successful, but if to boot one more vm with unicode-containing name, it will fall to ERROR state with the message like:
'Returning exception 'ascii' codec can't decode byte 0xe2 in position 359: ordinal not in range(128) to caller'

Moreover, if after this to try to boot any instance with ascii characters, it will fall to ERROR state with the same message.

It has been reproduced on env (3 controllers+2 computes, Cinder LVM):
[root@nailgun ~]# shotgun2 short-report
cat /etc/fuel_build_id:
 154
cat /etc/fuel_build_number:
 154
cat /etc/fuel_release:
 9.0
cat /etc/fuel_openstack_version:
 mitaka-9.0
rpm -qa | egrep 'fuel|astute|network-checker|nailgun|packetary|shotgun':
 fuel-misc-9.0.0-1.mos8259.noarch
 python-fuelclient-9.0.0-1.mos301.noarch
 fuel-9.0.0-1.mos6325.noarch
 fuel-provisioning-scripts-9.0.0-1.mos8611.noarch
 fuelmenu-9.0.0-1.mos263.noarch
 fuel-ui-9.0.0-1.mos2641.noarch
 fuel-migrate-9.0.0-1.mos8259.noarch
 fuel-ostf-9.0.0-1.mos921.noarch
 shotgun-9.0.0-1.mos87.noarch
 python-packetary-9.0.0-1.mos130.noarch
 fuel-bootstrap-cli-9.0.0-1.mos272.noarch
 fuel-nailgun-9.0.0-1.mos8611.noarch
 fuel-setup-9.0.0-1.mos6325.noarch
 rubygem-astute-9.0.0-1.mos733.noarch
 fuel-mirror-9.0.0-1.mos130.noarch
 fuel-openstack-metadata-9.0.0-1.mos8611.noarch
 fuel-notify-9.0.0-1.mos8259.noarch
 fuel-release-9.0.0-1.mos6325.noarch
 nailgun-mcagents-9.0.0-1.mos733.noarch
 network-checker-9.0.0-1.mos72.x86_64
 fuel-utils-9.0.0-1.mos8259.noarch
 fuel-library9.0-9.0.0-1.mos8259.noarch
 fuel-agent-9.0.0-1.mos272.noarch
[root@nailgun ~]#

Steps to reproduce:
1. Create a first instance with unicode characters in its name:
a=$'\u2234\u2192\u263f\u2605'
nova boot --flavor m1.micro --image TestVM --nic net-id=$(neutron net-list | awk '/admin_internal_net/{print $2}') vm$a
scheduler's log of creation process - http://paste.openstack.org/show/492900/
2. Check that it's in ACTIVE state:
root@node-1:~# nova show vm∴→☿★ | grep status
| status | ACTIVE |
3. Create another instance with unicode characters in its name:
nova boot --flavor m1.micro --image TestVM --nic net-id=$(neutron net-list | awk '/admin_internal_net/{print $2}') vm1$a
scheduler's log of creation process - http://paste.openstack.org/show/492901/
Expected result: the instance's booting is successful
Actual result: the instance's booting failed

Tags: area-nova
Changed in mos:
status: New → Confirmed
assignee: nobody → MOS Nova (mos-nova)
importance: Undecided → High
Changed in mos:
assignee: MOS Nova (mos-nova) → stgleb (gstepanov)
Revision history for this message
Andrey Volkov (avolkov) wrote :

Can't reproduce on my devstack: http://paste.openstack.org/show/497650/
On horizon.ssl.mirantis.net error shows immediately on first request: http://paste.openstack.org/show/497651/
It can be useful to see result of script: http://paste.openstack.org/show/497652/

Changed in mos:
assignee: stgleb (gstepanov) → Andrey Volkov (avolkov)
status: Confirmed → In Progress
Revision history for this message
Andrey Volkov (avolkov) wrote :

I've checked on MOS installation: ssh -l root -p 8022 172.18.204.8
Same result: http://paste.openstack.org/show/497717/

Revision history for this message
Andrey Volkov (avolkov) wrote :

Same check on fresh, just deployed MOS: http://paste.openstack.org/show/498030/

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Anna, could you please give it another try? ^

Changed in mos:
status: In Progress → Incomplete
assignee: Andrey Volkov (avolkov) → Anna Babich (ababich)
Revision history for this message
Anna Babich (ababich) wrote :

Andrey, please, try to reproduce it with debug=True in nova.conf

Changed in mos:
assignee: Anna Babich (ababich) → Andrey Volkov (avolkov)
importance: High → Medium
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

As long as it's only reproduced with debugging logging enabled (which is not true for production), let's downgrade this to Medium and fix in 10.0.

Changed in mos:
status: Incomplete → Won't Fix
Revision history for this message
Andrey Volkov (avolkov) wrote :

Yes, with debug=True it is reproducible.

Revision history for this message
Andrey Volkov (avolkov) wrote :

There are problems in oslo library related to encoding:

1. If in python 2.7 I try to log string like:

logging.warning('test message with unicode %s', u'☢ ☯ ☭ ∑ ∞ ♀ ♂ ♥'.encode('utf8'))

it's ok, but with olso:

from oslo_log import log as logging
LOG = logging.getLogger(__name__)
LOG.warning('test message with unicode %s', u'☢ ☯ ☭ ∑ ∞ ♀ ♂ ♥'.encode('utf8'))

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
0: ordinal not in range(128)

On https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py#L129
ensure_unicode is only for message but not for args.

2. If I replace previous code to:

LOG.warning(u'test message with unicode ☢ ☯ ☭ ∑ ∞ ♀ ♂ ♥'.encode('utf8'))

with syslog, I've got error like:
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_log/handlers.py", line 57, in emit
ERROR oslo_messaging.rpc.dispatcher self.format(record))
ERROR oslo_messaging.rpc.dispatcher TypeError: [priority,] message string

May be it's related to https://bugs.launchpad.net/oslo.log/+bug/1483842.

I'll make workraround to remove non ascii characters in log.

Revision history for this message
Andrey Volkov (avolkov) wrote :
Revision history for this message
Andrey Volkov (avolkov) wrote :

Checked on MOS mitaka-9.0, iso 376.
Logs look like http://paste.openstack.org/show/505588/.
Non ascii symbols encoded: display_name='barbaris1-∴→☿★'

Revision history for this message
Andrey Volkov (avolkov) wrote :
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

^ both bugs are fixed in Newton.

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.