Bug 1569605

Summary: OSP10->11->12 undercloud upgrade fails with: ERROR keystone DbMigrationError: (pymysql.err.InternalError) (1061, u"Duplicate key name 'ix_default_project_id'") [SQL: u'CREATE INDEX ix_default_project_id ON user (default_project_id)']
Product: Red Hat OpenStack Reporter: Marius Cornea <mcornea>
Component: rhosp-directorAssignee: Harry Rybacki <hrybacki>
Status: CLOSED NOTABUG QA Contact: Amit Ugol <augol>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 13.0 (Queens)CC: alee, ccamacho, dbecker, hrybacki, mburns, morazi, therve
Target Milestone: zstreamKeywords: Triaged, ZStream
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1570943 (view as bug list) Environment:
Last Closed: 2018-10-16 15:34:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1570943    

Description Marius Cornea 2018-04-19 14:49:02 UTC
Description of problem:
OSP10->11->12 undercloud upgrade fails with: ERROR keystone DbMigrationError: (pymysql.err.InternalError) (1061, u"Duplicate key name 'ix_default_project_id'") [SQL: u'CREATE INDEX ix_default_project_id ON user (default_project_id)']

Version-Release number of selected component (if applicable):
openstack-keystone-12.0.0-4.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Deploy OSP10 undercloud
2. Upgrade undercloud to 11
3. Upgrade undercloud to 12

Actual results:
Upgrade fails during keystone-manage  db_sync:

ERROR keystone DbMigrationError: (pymysql.err.InternalError) (1061, u"Duplicate key name 'ix_default_project_id'") [SQL: u'CREATE INDEX ix_default_project_id ON user (default_project_id)']

Expected results:

Upgrade doesn't fail

Additional info:
Attaching sosreport.

Comment 4 Ade Lee 2018-04-19 18:58:57 UTC
The issue here I think is basically that the migration script is not idempotent.
We're running into an issue where the script is being re-run as 22 - as it should be  - but failed because it is not idempotent.

It should be fixed and then backported as fixed to newton/ocata.

Comment 5 Ade Lee 2018-04-20 20:08:39 UTC
There is a patch to fix the issue upstream.  Once its merged, we'll backport to newton/ocata.

Comment 6 Ade Lee 2018-04-20 20:09:05 UTC
https://review.openstack.org/563266

Comment 7 Carlos Camacho 2018-09-07 11:21:05 UTC
Hello!

Any progress on this BZ?

Thanks.

Comment 8 Harry Rybacki 2018-10-16 15:34:01 UTC
Carlos, apologies for leaving this open. The patches backporting the migration from OSP12->11->10[1][2] were reverted after a second team review. This is no longer an issue for upgrades.

[1] - https://code.engineering.redhat.com/gerrit/#/c/129662/
[2] - https://code.engineering.redhat.com/gerrit/#/c/129658/

Closing as NOTABUG.