Bug 1133905

Summary: RHOS4->RHOS5 upgrade fails due to wrong version of python-migrate installed
Product: Red Hat OpenStack Reporter: Lars Kellogg-Stedman <lars>
Component: openstack-cinderAssignee: Lars Kellogg-Stedman <lars>
Status: CLOSED ERRATA QA Contact: Dafna Ron <dron>
Severity: high Docs Contact:
Priority: urgent    
Version: 5.0 (RHEL 6)CC: eharney, lars, markmc, sclewis, sgordon, slong, yeylon
Target Milestone: z1Keywords: ZStream
Target Release: 5.0 (RHEL 6)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-2014.1.2-3.el6ost Doc Type: Bug Fix
Doc Text:
In the previous version of OpenStack Block Storage, an older (0.7.x) version of the python-migrate package was installed. As a result, attempts by the database migration logic to use a module only available in the 0.8.x version of the package failed. With this fix, an explicit dependency on the newer version of the package has been introduced and database migrations can complete successfully.
Story Points: ---
Clone Of:
: 1139239 1139240 1139241 1139243 (view as bug list) Environment:
Last Closed: 2014-09-30 17:52:14 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: 1139239, 1139240, 1139241, 1139243    

Description Lars Kellogg-Stedman 2014-08-26 12:28:09 UTC
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

Comment 2 Lars Kellogg-Stedman 2014-08-26 12:38:16 UTC
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

Comment 3 Lars Kellogg-Stedman 2014-08-26 17:48:48 UTC
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 6 Dafna Ron 2014-09-11 16:09:42 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 10 errata-xmlrpc 2014-09-30 17:52:14 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/RHBA-2014-1343.html