migration 61 downgrade fails using mysql

Bug #1408658 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Brant Knudson

Bug Description

When trying to downgrade from version 61, it fails with an AttributeError.

$ keystone-manage db_sync 60
2015-01-08 08:29:56.494 CRITICAL keystone [-] AttributeError: 'MetaData' object has no attribute 'c'

2015-01-08 08:29:56.494 TRACE keystone Traceback (most recent call last):
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/bin/keystone-manage", line 6, in <module>
2015-01-08 08:29:56.494 TRACE keystone exec(compile(open(__file__).read(), __file__, 'exec'))
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/bin/keystone-manage", line 44, in <module>
2015-01-08 08:29:56.494 TRACE keystone cli.main(argv=sys.argv, config_files=config_files)
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/cli.py", line 311, in main
2015-01-08 08:29:56.494 TRACE keystone CONF.command.cmd_class.main()
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/cli.py", line 74, in main
2015-01-08 08:29:56.494 TRACE keystone migration_helpers.sync_database_to_version(extension, version)
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 204, in sync_database_to_version
2015-01-08 08:29:56.494 TRACE keystone _sync_common_repo(version)
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 160, in _sync_common_repo
2015-01-08 08:29:56.494 TRACE keystone init_version=init_version)
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/oslo.db/oslo_db/sqlalchemy/migration.py", line 82, in db_sync
2015-01-08 08:29:56.494 TRACE keystone version)
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 202, in downgrade
2015-01-08 08:29:56.494 TRACE keystone return _migrate(url, repository, version, upgrade=False, err=err, **opts)
2015-01-08 08:29:56.494 TRACE keystone File "<string>", line 2, in _migrate
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2015-01-08 08:29:56.494 TRACE keystone return f(*a, **kw)
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
2015-01-08 08:29:56.494 TRACE keystone schema.runchange(ver, change, changeset.step)
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 93, in runchange
2015-01-08 08:29:56.494 TRACE keystone change.run(self.engine, step)
2015-01-08 08:29:56.494 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 148, in run
2015-01-08 08:29:56.494 TRACE keystone script_func(engine)
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migrate_repo/versions/061_add_parent_project.py", line 50, in downgrade
2015-01-08 08:29:56.494 TRACE keystone migration_helpers.remove_constraints(list_constraints(meta))
2015-01-08 08:29:56.494 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migrate_repo/versions/061_add_parent_project.py", line 24, in list_constraints
2015-01-08 08:29:56.494 TRACE keystone 'ref_column': project_table.c.id}]
2015-01-08 08:29:56.494 TRACE keystone AttributeError: 'MetaData' object has no attribute 'c'
2015-01-08 08:29:56.494 TRACE keystone

Brant Knudson (blk-u)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
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/145795

Changed in keystone:
status: New → In Progress
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/145795
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=529da7496babafad0ef8295bf6a5cc918c2bfefb
Submitter: Jenkins
Branch: master

commit 529da7496babafad0ef8295bf6a5cc918c2bfefb
Author: Brant Knudson <email address hidden>
Date: Thu Jan 8 08:37:10 2015 -0600

    Fix downgrade from migration 61 on non-sqlite

    Downgrading from migration 61 on non-sqlite databases was failing
    with an AttributeError.

    Change-Id: Ia972c49d3f41853bdd3bccab9f839bd8b922f3e7
    Closes-Bug: #1408658

Changed in keystone:
status: In Progress → Fix Committed
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/146497

Thierry Carrez (ttx)
Changed in keystone:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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

commit 1f93ae0c8de981d342b94258a14097f168e5536e
Author: Boris Bobrov <email address hidden>
Date: Mon Jan 12 17:05:18 2015 +0300

    Fix downgrade test for migration 61 on non-sqlite

    One of the downgrade tests was failing on non-sqlite because of foreign
    key constraint violation.

    Change-Id: I6f85e1040ffd6e6d3222cf2c2a9bce4875f6a95f
    Closes-Bug: 1409716
    Partial-Bug: 1408658

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