db_sync breaks in non-utf8 databases on region table

Bug #1334779 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Morgan Fainberg
Icehouse
Fix Released
Medium
Morgan Fainberg

Bug Description

The migration that creates the region table does not explicitly set utf8 so if the database default is not set, then db_sync fails with the following error:

2014-06-26 17:00:48.231 965 CRITICAL keystone [-] ValueError: Tables "region" have non utf8 collation, please make sure all tables are CHARSET=utf8
2014-06-26 17:00:48.231 965 TRACE keystone Traceback (most recent call last):
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/bin/keystone-manage", line 51, in <module>
2014-06-26 17:00:48.231 965 TRACE keystone cli.main(argv=sys.argv, config_files=config_files)
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 191, in main
2014-06-26 17:00:48.231 965 TRACE keystone CONF.command.cmd_class.main()
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 67, in main
2014-06-26 17:00:48.231 965 TRACE keystone migration_helpers.sync_database_to_version(extension, version)
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 139, in sync_database_to_version
2014-06-26 17:00:48.231 965 TRACE keystone migration.db_sync(sql.get_engine(), abs_path, version=version)
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/openstack/common/db/sqlalchemy/migration.py", line 195, in db_sync
2014-06-26 17:00:48.231 965 TRACE keystone _db_schema_sanity_check(engine)
2014-06-26 17:00:48.231 965 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/openstack/common/db/sqlalchemy/migration.py", line 228, in _db_schema_sanity_check
2014-06-26 17:00:48.231 965 TRACE keystone ) % ','.join(table_names))
2014-06-26 17:00:48.231 965 TRACE keystone ValueError: Tables "region" have non utf8 collation, please make sure all tables are CHARSET=utf8
2014-06-26 17:00:48.231 965 TRACE keystone

tags: added: icehouse-backport-potential
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/102964

Changed in keystone:
assignee: nobody → Morgan Fainberg (mdrnstm)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/102964
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=e4968f3bf8a5c0cbe21d37262c8a07362af9043b
Submitter: Jenkins
Branch: master

commit e4968f3bf8a5c0cbe21d37262c8a07362af9043b
Author: Morgan Fainberg <email address hidden>
Date: Thu Jun 26 15:24:20 2014 -0700

    Correct the region table to be InnoDB and UTF8

    The region table was not specified as being InnoDB or UTF8 under
    mysql initially. The migration will fail if the defaults for MySQL
    are not set correctly. A new method has been added to the
    migration_helpers module to detect and correct the InnoDB / UTF8
    specific issue with the region table.

    Change-Id: I374c3dd46a4292e8f9e74ef75a8bb463b951f135
    Closes-Bug: #1334779

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/106486

Changed in keystone:
milestone: none → juno-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/icehouse)

Reviewed: https://review.openstack.org/106486
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=774b6ababa04ba627a9e9984f366ce07462a0d76
Submitter: Jenkins
Branch: stable/icehouse

commit 774b6ababa04ba627a9e9984f366ce07462a0d76
Author: Morgan Fainberg <email address hidden>
Date: Fri Jul 11 15:24:10 2014 -0500

    Correct the region table to be InnoDB and UTF8

    The region table was not specified as being InnoDB or UTF8 under
    mysql initially. The migration will fail if the defaults for MySQL
    are not set correctly. A new method has been added to the
    migration_helpers module to detect and correct the InnoDB / UTF8
    specific issue with the region table.

    Change-Id: I374c3dd46a4292e8f9e74ef75a8bb463b951f135
    Closes-Bug: #1334779

Chuck Short (zulcss)
tags: added: in-stable-icehouse
removed: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/121711

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Ryan Hsu (<email address hidden>) on branch: master
Review: https://review.openstack.org/121711
Reason: Testing

Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-2 → 2014.2
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.