[Bug 1507937] Re: Tenant does not support non-ascii characters

Seyeong Kim seyeong.kim at canonical.com
Fri Mar 23 12:00:16 UTC 2018


Hello

I had different reproduce not using ldap here.

Please refer to below steps for reproducer and verification

1. deploy openstack xenial env 
2. source novarc ( as admin )
3. keystone user-create --user test
4. log into keystone node and install mysql-client
5. connect to mysql with keystone user
6. do below query
- set foreign_key_checks = 0
- update local_user set user_id='Gāo' where user_id='UUID';
- update user set id='Gāo' where id='UUID';
- set foreign_key_checks = 1
7. keystone user-role-add --user test --tenant admin --role Admin
8. source novarc ( as test )
9. nova list

got unicode error on nova-cloud-controller node /var/log/syslog

10. upgraded python-oslo.context on -proposed repo

11. back to client node and nova list
12. it returns correct table without any server

Thanks

dpkg -l | grep oslo.context
ii  python-oslo.context              2.2.0-2ubuntu1                             all          WSGI context helpers for OpenStack - Python 2.x


** Tags removed: verification-needed-xenial
** Tags added: verification-done-xenial

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-oslo.context in Ubuntu.
https://bugs.launchpad.net/bugs/1507937

Title:
  Tenant does not support non-ascii characters

Status in Ubuntu Cloud Archive:
  Fix Released
Status in Ubuntu Cloud Archive kilo series:
  Triaged
Status in Ubuntu Cloud Archive mitaka series:
  Triaged
Status in oslo.context:
  Fix Released
Status in python-oslo.context package in Ubuntu:
  Invalid
Status in python-oslo.context source package in Xenial:
  Fix Committed

Bug description:
  [Impact]

  Affected to trusty-mitaka, only has older form of user id

  Assume that there is unicode user id (like John Gāo) from ldap on trusty-kilo env.
  and Upgraded to trusty-mitaka.

  I can't command nova list with 500 error and nova-api log show us
  unicode error like below

  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in
  position 1: ordinal not in range(128)

  [Test Case]

  TBD for detail script or info

  0. proper ldap setting(accounts etc..) with user id has unicode character as above
  1. deploy trusty-kilo env
  - without ldap config,
  - if i set ldap config at the beginning, there is error because by default config blocks CRUD user on ldap)
  2. setting ldap configuration
  - https://pastebin.ubuntu.com/p/pfzNDPgccd/
  3. remove CRUD block on keystone.conf temporarily
  - https://pastebin.ubuntu.com/p/HD7mPwHDjM/
  4. need to set up password for nova, cinder, etc service accounts
  - openstack user set --password-prompt nova ( for all services )
  - you can check password in each services configuration file
  5. upgrade to trusty-mitaka
  - https://pastebin.ubuntu.com/p/d6Wcp7HQVr/
  6. source novarc
  7. nova list

  you can get 500 error

  [Regression]

  This patch is simple, but need to restart every api service e.g nova-
  api, glance-api, cinder-api etc because they are handling user id for
  getting information respectively. This causes temporarily service
  down.

  [Others]

  If I deployed trusty-mitaka in the beginning, keystone user id is form
  of uuid, so no need to patch this basically.

  [Original description]
  When Tenant name contains any non-acsii characters (such as Chinese), calling oslo_context/context.py#to_dict method will cause a unicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128).

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1507937/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list