Bug 1139243

Summary: RHOS4->RHOS5 upgrade fails due to wrong version of python-migrate installed
Product: Red Hat OpenStack Reporter: Lon Hohberger <lhh>
Component: openstack-glanceAssignee: Flavio Percoco <fpercoco>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: high Docs Contact: Dafna Ron <dron>
Priority: urgent    
Version: 5.0 (RHEL 6)CC: dron, eglynn, fpercoco, lars, markmc, sclewis, sgordon, yeylon
Target Milestone: z1Keywords: ZStream
Target Release: 5.0 (RHEL 6)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-glance-2014.1.2-3.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1133905 Environment:
Last Closed: 2014-09-30 17:15:40 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: 1133905    
Bug Blocks:    

Description Lon Hohberger 2014-09-08 13:08:07 UTC
+++ This bug was initially created as a clone of Bug #1133905 +++

Dafna was following our upgrade documentation and ran into the following error while trying to upgrade the Cinder database:

  Can't determine the existing sync level.
  Please ensure the database is running and already initialised.

The actual error from /var/log/cinder/cinder-manage.log, was:

  TRACE cinder   File "/usr/lib/python2.6/site-packages/cinder/utils.py", line 423, in __get_backend
  TRACE cinder     self.__backend = __import__(name, None, None, fromlist)
  TRACE cinder   File "/usr/lib/python2.6/site-packages/cinder/db/sqlalchemy/migration.py", line 21, in <module>
  TRACE cinder     from migrate.versioning import api as versioning_api
  TRACE cinder   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 33, in <module>
  TRACE cinder     from migrate.versioning import (repository, schema, version,
  TRACE cinder   File "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 10, in <module>
  TRACE cinder     from sqlalchemy import exceptions as sa_exceptions
  TRACE cinder ImportError: cannot import name exceptions

This is caused because after upgrading the openstack packages, python-migrate is still at version python-migrate-0.7.1-1.el6ost.noarch, while version python-migrate-0.8.2-2.el6ost.noarch is required.  The workaround is to manually upgrade python-migrate:

    yum upgrade python-migrate

The solution is to set a versioned Requires: on all of the openstack packages that require python-migrate.  According to 'repoquery --whatrequires python-migrate', this is:

  openstack-heat-common
  python-ceilometer
  python-cinder
  python-glance
  python-keystone
  python-nova

--- Additional comment from Lars Kellogg-Stedman on 2014-08-26 08:38:16 EDT ---

Using the openstack-cinder spec file as an example, I would probably change:

Requires:         python-sqlalchemy
Requires:         python-migrate

To:

Requires:         python-sqlalchemy >= 0.8.4
Requires:         python-migrate >= 0.8.2

--- Additional comment from Lars Kellogg-Stedman on 2014-08-26 13:48:48 EDT ---

Fixed in:

openstack-heat-2014.1.2-2.0.el6ost
openstack-ceilometer-2014.1.2-2.el6ost
openstack-cinder-2014.1.2-3.el6ost
openstack-glance-2014.1.2-3.el6ost
openstack-nova-2014.1.2-4.el6ost

This was previously fixed in:

openstack-keystone-2014.1.2.1-2.el6ost

Comment 3 Dafna Ron 2014-09-11 16:29:58 UTC
we do not fail on upgrade and the package exists after upgrade: 
[root@RHEL6 ~]# rpm -qa |grep python-sqlalchemy
python-sqlalchemy-0.8.4-1.el6ost.x86_64
python-sqlalchemy0.7-0.7.8-1.el6ost.x86_64
[root@RHEL6 ~]# rpm -qa |grep python-migrat
python-migrate-0.8.2-2.el6ost.noarch
[root@RHEL6 ~]#

Comment 5 errata-xmlrpc 2014-09-30 17:15:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-1338.html