sql: migration from 37 to 38 version fails

Bug #1320855 reported by Emilien Macchi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Emilien Macchi
Icehouse
Fix Released
Medium
Emilien Macchi

Bug Description

Migration from Havana to Icehouse fails due to db_sync error, when migrating 37 to 38 sql schema:

CRITICAL keystone [-] OperationalError: (OperationalError) (1005, "Can't create table 'keystone.assignment' (errno: 150)") "\nCREATE TABLE assignment (\n\ttype ENUM('UserProject','GroupProject','UserDomain','GroupDomain') NOT NULL, \n\tactor_id VARCHAR(64) NOT NULL, \n\ttarget_id VARCHAR(64) NOT NULL, \n\trole_id VARCHAR(64) NOT NULL, \n\tinherited BOOL NOT NULL, \n\tPRIMARY KEY (type, actor_id, target_id, role_id), \n\tFOREIGN KEY(role_id) REFERENCES role (id), \n\tCHECK (inherited IN (0, 1))\n)\n\n" ()#0122014-05-19 09:57:51.445 40373 TRACE keystone Traceback (most recent call last):#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/bin/keystone-manage", line 51, in <module>#0122014-05-19 09:57:51.445 40373 TRACE keystone cli.main(argv=sys.argv, config_files=config_files)#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 191, in main#0122014-05-19 09:57:51.445 40373 TRACE keystone CONF.command.cmd_class.main()#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 67, in main#0122014-05-19 09:57:51.445 40373 TRACE keystone migration_helpers.sync_database_to_version(extension, version)#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 139, in sync_database_to_version#0122014-05-19 09:57:51.445 40373 TRACE keystone migration.db_sync(sql.get_engine(), abs_path, version=version)#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/lib/python2.7/dist-packages/keystone/openstack/common/db/sqlalchemy/migration.py", line 197, in db_sync#0122014-05-19 09:57:51.445 40373 TRACE keystone return versioning_api.upgrade(engine, repository, version)#0122014-05-19 09:57:51.445 40373 TRACE keystone File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade#0122014-05-19 09:57:51.445 40373 TRACE keystone

Changed in keystone:
assignee: nobody → Emilien Macchi (emilienm)
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/94187

Changed in keystone:
status: New → In Progress
Revision history for this message
Lance Bragstad (lbragstad) wrote :

I am unable to recreate this. Are you able to list the steps you took to recreate this?

I dropped my keystone database, created a new empty one, and ran all migrations up to the latest.

mysql> select * from migrate_version\G
*************************** 1. row ***************************
  repository_id: keystone
repository_path: /opt/stack/keystone/keystone/common/sql/migrate_repo
        version: 50
1 row in set (0.00 sec)

Revision history for this message
Lance Bragstad (lbragstad) wrote :

Here were the steps that I took to try and recreate:

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

Revision history for this message
Emilien Macchi (emilienm) wrote :

@Lance
I don't want to recreate, I'm working on production servers and want to use the keystone manage CLI to upgrade the DB by the regular way.

Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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

commit 18289b9e26ba900302874e72fcbf4529580a973a
Author: Emilien Macchi <email address hidden>
Date: Mon May 19 14:40:44 2014 +0200

    sql migration: ensure using innodb utf8 for assignment table

    During migration from 37 to 38, migration fails to create assignment
    table if we don't explictly specify InnoDB and UTF8 charset.

    Closes-bug #1320855
    Signed-off-by: Emilien Macchi <email address hidden>

    Change-Id: Icd88202d2f020aea02514e49c2d07e349c74949f

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/95601

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/icehouse)

Reviewed: https://review.openstack.org/95601
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=4408625031bc9804fa4bd4a72988bf31375b7787
Submitter: Jenkins
Branch: stable/icehouse

commit 4408625031bc9804fa4bd4a72988bf31375b7787
Author: Emilien Macchi <email address hidden>
Date: Mon May 19 14:40:44 2014 +0200

    sql migration: ensure using innodb utf8 for assignment table

    During migration from 37 to 38, migration fails to create assignment
    table if we don't explictly specify InnoDB and UTF8 charset.

    Closes-bug #1320855
    Signed-off-by: Emilien Macchi <email address hidden>

    Change-Id: Icd88202d2f020aea02514e49c2d07e349c74949f
    (cherry picked from commit 18289b9e26ba900302874e72fcbf4529580a973a)

Thierry Carrez (ttx)
Changed in keystone:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-1 → 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.