Bug 1329137 - DB migration fail from 5.5 - 5.6 with openstack provider
Summary: DB migration fail from 5.5 - 5.6 with openstack provider
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Beta 2
: 5.6.0
Assignee: Ladislav Smola
QA Contact: luke couzens
URL:
Whiteboard: update:migration:openstack
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-21 09:37 UTC by luke couzens
Modified: 2016-06-29 15:52 UTC (History)
8 users (show)

Fixed In Version: 5.6.0.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 15:52:05 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description luke couzens 2016-04-21 09:37:34 UTC
Description of problem:migration from 5.5.3.4 to 5.6.0.1-beta2 fails when you have an openstack provider


Version-Release number of selected component (if applicable):5.6.0.1-beta2


How reproducible:100%


Steps to Reproduce:
1.provision 5.5.3.4 appliance
2.add openstack provider
3.backup database
4.provision blank 5.6.0.1-beta2 appliance
5.ssh to appliance and configure db
6.fetch the v2_key from the 5.5 appliance and set the same region number
7.once the webui is available stop evmserverd
8.scp your backup to 5.6 appliance
9.run dropdb vmdb_production
10.run createdb vmdb_production
11.restore database to 5.6 appliance
12.rake db:migrate

Actual results: rake fails on

== 20160226092911 SeparateOpenstackNetworkManagerFromOpenstackCloudManager: migrating 
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

unknown attribute 'parent_ems_id' for SeparateOpenstackNetworkManagerFromOpenstackCloudManager::ExtManagementSystem./opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activemodel/lib/active_model/attribute_assignment.rb:48:in `_assign_attribute'

Expected results: Migration completes


Additional info:

Comment 2 Greg Blomquist 2016-04-21 14:10:43 UTC
Ladas, can you look at this migration?  It's failing on an upgrade.

Comment 3 Ladislav Smola 2016-04-25 08:16:14 UTC
The field that is missing was added in migration AddParentEmsIdToExtManagementSystem . Has this one succeeded?

Comment 5 CFME Bot 2016-05-02 20:56:02 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/fd2430f1aff2520778ca4e92d8782e01a2f7b8bb

commit fd2430f1aff2520778ca4e92d8782e01a2f7b8bb
Author:     Ladislav Smola <lsmola>
AuthorDate: Mon Apr 25 11:33:28 2016 +0200
Commit:     Ladislav Smola <lsmola>
CommitDate: Mon Apr 25 13:07:04 2016 +0200

    Production migration fail due to cached schema for model
    
    Production migration fails due to cached schema for model. Model
    contains old schema, so the field parent_ems_id, that we created
    couple of migrations back, will not be in the model
    ExtManagementSystem and it will fail on create!. Seems like
    this appears only on production env, where the schema is not
    reloaded. Also this occurs only when we do e.g. upgrade, so
    when migration has some data, before we continue with other
    migrations. This migration is data migration touching OpenStack.
    
    Fixes BZ:
    https://bugzilla.redhat.com/show_bug.cgi?id=1329137

 ...1_separate_openstack_network_manager_from_openstack_cloud_manager.rb | 2 ++
 1 file changed, 2 insertions(+)

Comment 6 luke couzens 2016-05-04 15:43:59 UTC
verified in 5.6.0.5-beta2.4

Comment 9 errata-xmlrpc 2016-06-29 15:52:05 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.

https://access.redhat.com/errata/RHBA-2016:1348


Note You need to log in before you can comment on or make changes to this bug.