It is possible to create objects in OpenStack with Unicode symbols and it will corrupt everything

Bug #1543102 reported by Alexey Galkin on 2016-02-08
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
High
Dmitry Burmistrov
7.0.x
High
Rodion Tikunov
8.0.x
High
MOS Maintenance
9.x
High
Dmitry Burmistrov

Bug Description

VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  api: "1.0"
  build_number: "529"
  build_id: "529"
  fuel-nailgun_sha: "baec8643ca624e52b37873f2dbd511c135d236d9"
  python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
  fuel-agent_sha: "658be72c4b42d3e1436b86ac4567ab914bfb451b"
  fuel-nailgun-agent_sha: "b2bb466fd5bd92da614cdbd819d6999c510ebfb1"
  astute_sha: "b81577a5b7857c4be8748492bae1dec2fa89b446"
  fuel-library_sha: "e2d79330d5d708796330fac67722c21f85569b87"
  fuel-ostf_sha: "3bc76a63a9e7d195ff34eadc29552f4235fa6c52"
  fuel-mirror_sha: "fb45b80d7bee5899d931f926e5c9512e2b442749"
  fuelmenu_sha: "e071216cb214e34b4d861478033425ee6a54a3be"
  shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
  network-checker_sha: "a43cf96cd9532f10794dce736350bf5bed350e9d"
  fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
  fuelmain_sha: "a365f05b903368225da3fea9aa42afc1d50dc9b4"

Steps to reproduce:

1. Login into Horizon and create new instance with name: "試験画像".

Excepted result:

successfully created and launched

Actual result:

Error: Failed to perform requested operation on instance "試験画像", the instance has an error status: Please try again later [Error: Build of instance ada6a494-f363-4dfb-abbf-d68cc749b2eb aborted: Could not clean up failed build, not rescheduling].

Traceback from nova logs:
http://paste.openstack.org/show/486274/

2. Trying to create a new instance with normal name: "test_instance". (floating bug, does not always reproduced).

Excepted result:

successfully created and launched

Actual result:

Error: Failed to perform requested operation on instance "test_instance", the instance has an error status: Please try again later [Error: Build of instance d45a597f-9736-46c5-bd4a-dd56f6b05b64 aborted: Could not clean up failed build, not rescheduling].

3. Go to controller by ssh use this command:
root@node-1:~# source openrc
root@node-1:~# nova list

Excepted result:

root@node-1:~# nova list
+--------------------------------------+---------------+--------+------------+-------------+-----------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------------+--------+------------+-------------+-----------------------------------+
| 250e4f81-5f27-4b8d-9c64-827707323944 | normal-name | ACTIVE | - | Running | admin_internal_net=192.168.111.12 |
| d45a597f-9736-46c5-bd4a-dd56f6b05b64 | 試験画像 | ACTIVE | - | Running | admin_internal_net=192.168.111.10 |
| 2c564921-f80c-44fd-8472-daaa44fa80c0 | test_instance | ACTIVE | - | Running | admin_internal_net=192.168.111.9 |
+--------------------------------------+---------------+--------+------------+-------------+-----------------------------------+

Actual result:

root@node-1:~# nova list
ERROR (UnicodeEncodeError): 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

4. Go to controller by ssh use this command:
root@node-1:~# glance image-create --name 試験画像
root@node-1:~# glance image-list

Excepted result:

root@node-1:~# glance image-list
+--------------------------------------+--------+
| ID | Name |
+--------------------------------------+--------+
| 237c056a-cd4d-4eda-9e7e-21a4830d7b0a | 試験画像 |
| 93104584-39d9-4577-8a7b-ebc0e8e6157c | TestVM |
+--------------------------------------+--------+

Actual result:

root@node-1:~# glance image-create --name 試験画像
'ascii' codec can't encode characters in position 621-624: ordinal not in range(128)
root@node-1:~# glance image-list
'ascii' codec can't encode characters in position 301-304: ordinal not in range(128)

The same problems with the other remaining MOS components.

I think that unicode locale must be installed in order to avoid such problems.

summary: - It is possible to create objects in OpenStack with unicode symbols and
- it will corrupt everythink
+ It is possible to create objects in OpenStack with Unicode symbols and
+ it will corrupt everything
Roman Podoliaka (rpodolyaka) wrote :

This must not be critical (please see importance levels definition here https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Confirm_and_triage_bugs ), as there is a work around: set the correct locale manually.

Moreover, this is misleading: the failures in clients you shown *must not* boot of instances - it fails on displaying the output to CLI. OpenStack APIs must work correctly.

tags: added: area-mos
removed: fuel neutron nova
Roman Podoliaka (rpodolyaka) wrote :

Let's make sure we set the correct locale when deploying slaves, though.

Roman, in fact, Nova can't boot VM if we already have some VMs with Unicode and we can see the error about Unicode characters in Nova compute log files.

This is why it was marked as Critical (because not only CLI is affected).

Roman Podoliaka (rpodolyaka) wrote :

Timur, I just successfully booted a VM with a non-ascii name on 8.0:

http://paste.openstack.org/show/486800/

So I still believe it's only CLI, which is affected.

tags: added: release-notes
AntonioK (rc5hack) wrote :

possible workaround for CLI is unsetting LC_ALL environment: https://bugs.launchpad.net/mos/+bug/1529607/comments/2

tags: added: customer-found
tags: added: 8.0 release-notes-done
removed: release-notes
Ivan Berezovskiy (iberezovskiy) wrote :

Patch for 9.0 is here https://review.openstack.org/#/c/297755/ and it's merged.

[root@nailgun ~]# shotgun2 short-report
cat /etc/fuel_build_id:
 164
cat /etc/fuel_build_number:
 164
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-release-9.0.0-1.mos6329.noarch
 python-fuelclient-9.0.0-1.mos302.noarch
 fuel-9.0.0-1.mos6329.noarch
 nailgun-mcagents-9.0.0-1.mos736.noarch
 fuel-misc-9.0.0-1.mos8274.noarch
 fuel-library9.0-9.0.0-1.mos8274.noarch
 fuel-agent-9.0.0-1.mos272.noarch
 fuel-ui-9.0.0-1.mos2646.noarch
 fuel-migrate-9.0.0-1.mos8274.noarch
 fuel-provisioning-scripts-9.0.0-1.mos8634.noarch
 shotgun-9.0.0-1.mos87.noarch
 network-checker-9.0.0-1.mos72.x86_64
 fuel-bootstrap-cli-9.0.0-1.mos272.noarch
 fuel-notify-9.0.0-1.mos8274.noarch
 fuel-ostf-9.0.0-1.mos923.noarch
 fuel-setup-9.0.0-1.mos6329.noarch
 python-packetary-9.0.0-1.mos131.noarch
 fuelmenu-9.0.0-1.mos265.noarch
 fuel-openstack-metadata-9.0.0-1.mos8634.noarch
 fuel-nailgun-9.0.0-1.mos8634.noarch
 rubygem-astute-9.0.0-1.mos736.noarch
 fuel-mirror-9.0.0-1.mos131.noarch
 fuel-utils-9.0.0-1.mos8274.noarch
[root@nailgun ~]#

Related fix proposed to branch: 7.0
Change author: Rodion Tikunov <email address hidden>
Review: https://review.fuel-infra.org/20690

Rodion Tikunov (rtikunov) wrote :

For fixing this bug in 7.0 LC_ALL=C needs to be unseted manually or in openrc file.
Proposed fix: https://review.openstack.org/#/c/317324/

tags: added: on-verification
Ekaterina Shutova (eshutova) wrote :

Verified on MOS 7.0 + MU6 updates.

Checked scenarios of creation networks and images with "Тест1" name(creation of instances works correctly, nova is not affected):

Before we can't check network list(or image list):
root@node-4:~# neutron net-list
'ascii' codec can't encode characters in position 586-591: ordinal not in range(128)
With fix we could see both:
root@node-4:~# neutron net-list
+--------------------------------------+-----------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-----------+-------------------------------------------------------+
| 9d9ffa39-60ec-4772-9a4f-2993baa1200e | net04_ext | 7f01d955-00ba-49d8-893b-8cdcede356a4 10.109.13.0/24 |
| 15632d15-fa5a-466c-872a-fc4c6545528d | net04 | b93e72d6-a589-41b1-a6a1-4e658d7b066a 192.168.111.0/24 |
| 512d11e5-8868-43e3-a4ea-c74d0d30c95a | аврора | |
+--------------------------------------+-----------+-------------------------------------------------------+
root@node-4:~# glance image-list
+--------------------------------------+--------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------+-------------+------------------+----------+--------+
| 8197dd90-0e59-4c40-a2a4-02d14f0338cb | TestVM | qcow2 | bare | 13287936 | active |
| 8f6af932-e9bc-4173-8a79-96b1661c0885 | тест1 | qcow2 | bare | 8318 | active |
+--------------------------------------+--------+-------------+------------------+----------+--------+

Small comment: in openrc file LC_ALL=C is not present, but we need to unset in manually by "unset LC_ALL=C" because SSH forwards it from server to master node and then to controller.

tags: removed: on-verification
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers