DB migration 57 failed on db2

Bug #1431250 reported by Ethan Lynn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Ethan Lynn

Bug Description

My db backend is db2, and db_sync failed at 057.
[root@dn1-n6 ~]# heat-manage db_sync
ERROR: list index out of range
[root@dn1-n6 ~]# heat-manage db_version
56

Error code is:
https://github.com/openstack/heat/blob/master/heat/db/sqlalchemy/migrate_repo/versions/057_resource_uuid_to_id.py#L41-L44
    fkc_name = inspector.get_foreign_keys('resource_data')[0]['name']
    fkc = ForeignKeyConstraint([rd_table.c.resource_id], [res_table.c.id],
                               fkc_name)
    migrate_engine.execute(DropConstraint(fkc))

get_foreign_keys returns [] in db2.

Revision history for this message
Ethan Lynn (ethanlynn) wrote :

This issue block our internal build.

Changed in heat:
assignee: nobody → Ethan Lynn (ethanlynn)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/163748
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=d005f2db6c47ff546c7ac173724fc5f3ee4e37cb
Submitter: Jenkins
Branch: master

commit d005f2db6c47ff546c7ac173724fc5f3ee4e37cb
Author: Ethan Lynn <email address hidden>
Date: Thu Mar 12 18:05:30 2015 +0800

    Fix db migration script 057 failure on db2

    Add a if condition before drop foreign key constraint.

    Closes-Bug: #1431250
    Change-Id: Idc3afeb8739a608ae618c605eb730a4eb3e3da84

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-3 → 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.