api db_sync fails on upgrade due to duplicate migration files

Bug #1665370 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Invalid
High
Unassigned

Bug Description

I'm testing upgrades on TripleO, and hit this problem, discussion with owalsh indicates it may be a nova bug related to backport migration numbering:

14:44 < owalsh> shardy: it's a nova bug, 028 needs to be renamed to 021_build_requests_instance_mediumtext.py in ocata &
                master

This is the error:

"ScriptError: You can only have one Python script per version, but you have: /usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_build_requests_instance_mediumtext.py and /usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_placeholder.py"], "warnings": []}

I'm testing this version:

[root@overcloud-controller-0 ~]# rpm -qf /usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_placeholder.py
python-nova-15.0.0-0.20170215034806.bdeb05d.el7.centos.noarch

So upgrading to:
https://github.com/openstack/nova/commit/bdeb05dfb0f727654ac0b0bae14341fd87b5cbb7

From stable/newton commit:
https://github.com/openstack/nova/commit/c6743ca709d45334cf25332aa834f86a9d91f1a5

[root@overcloud-controller-0 ~]# rpm -qa --last | grep python-nova
python-nova-15.0.0-0.20170215034806.bdeb05d.el7.centos.noarch Wed 15 Feb 2017 07:02:12 PM UTC
python-nova-14.0.4-0.20170117154931.c6743ca.el7.centos.noarch Mon 23 Jan 2017 01:45:50 PM UTC

Tags: db
Steven Hardy (shardy)
Changed in tripleo:
milestone: none → ocata-rc1
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Steven Hardy (shardy)
Revision history for this message
Matt Riedemann (mriedem) wrote :
tags: added: db ocata-rc-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

Dan pointed out to me in IRC the problem is 021_placement in stable/ocata conflicts with 021 from stale/newton.

Changed in tripleo:
milestone: ocata-rc1 → ocata-rc2
Matt Riedemann (mriedem)
tags: removed: ocata-rc-potential
Revision history for this message
Steven Hardy (shardy) wrote :

Ok so further testing this may be packaging related, as I ended up with two versions of python-nova installed:

[root@overcloud-controller-0 ~]# rpm -ql python-nova | grep migrate_repo | grep "py$" | grep 021
/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_build_requests_instance_mediumtext.py
/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_placeholder.py
[root@overcloud-controller-0 ~]# rpm -qa | grep python-nova
python-nova-15.0.0-0.20170215034806.bdeb05d.el7.centos.noarch
python-nova-14.0.4-0.20170117154931.c6743ca.el7.centos.noarch
[root@overcloud-controller-0 ~]# rpm -qf /usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_build_requests_instance_mediumtext.py
python-nova-14.0.4-0.20170117154931.c6743ca.el7.centos.noarch
[root@overcloud-controller-0 ~]# rpm -qf /usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api_migrations/migrate_repo/versions/021_placeholder.py
python-nova-15.0.0-0.20170215034806.bdeb05d.el7.centos.noarch

It's not yet clear how that happened, but I'll remove nova from this since it appears to be an issue specific to package updates and/or the tripleo upgrade workflow (in particular I think we can end up in this state if an upgrade fails during the package upgrade, then the upgrade is re-attempted).

no longer affects: nova
Changed in tripleo:
importance: Critical → High
Changed in tripleo:
milestone: ocata-rc2 → pike-1
Steven Hardy (shardy)
Changed in tripleo:
status: Triaged → Invalid
milestone: pike-1 → none
assignee: Steven Hardy (shardy) → nobody
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.