alembic/sqlalchemy fails to migrate when PostgreSQL lc_messages is set to 'non-ascii' language

Bug #1451563 reported by Sebastian Podjasek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
networking-cisco
New
Undecided
Unassigned

Bug Description

When you try to upgrade from juno to kilo and your database server is PostgreSQL configured with for ex. `lc_messages = 'pl_PL.UTF-8'`, alembic migration will fail with following mysterious traceback:

  File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/versions/589f9237ca0e_cisco_n1kv_ml2_driver_tables.py", line 113, in upgrade
    sa.PrimaryKeyConstraint('tenant_id', 'profile_id')
[......]
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 20: ordinal not in range(128)
dpkg: error processing package neutron-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of neutron-server:
 neutron-server depends on neutron-common (= 2015.1.0-1); however:
  Package neutron-common is not configured yet.

when instead it should report this:

  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 439, in do_execute
    cursor.execute(statement, parameters)
oslo_db.exception.DBError: (ProgrammingError) type "profile_type" already exists
 "CREATE TYPE profile_type AS ENUM ('network', 'policy')" {}

This exception is thrown due to localized error message: `BŁĄD: typ "profile_type" już istnieje` which contains non-ascii characters. I guess there should be no constraint on server response string (error) to be an ascii string.

affects: openstack-community → networking-cisco
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.