Bug 1644083 - Document a known issue around the miq_workers table when upgrading from Red Hat CloudForms 4.2 to 4.6
Summary: Document a known issue around the miq_workers table when upgrading from Red H...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Documentation
Version: 5.9.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.6
Assignee: Chris Budzilowicz
QA Contact: Red Hat CloudForms Documentation
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1622587 1644862
TreeView+ depends on / blocked
 
Reported: 2018-10-30 00:57 UTC by Nikhil Gupta
Modified: 2021-12-10 18:05 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1644862 (view as bug list)
Environment:
Last Closed: 2019-01-09 17:03:13 UTC
Category: Bug
Cloudforms Team: Documentation
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3669301 0 None None None 2018-10-30 00:58:01 UTC

Description Nikhil Gupta 2018-10-30 00:57:19 UTC
Description of problem:
After applying the procedure for migrating from 4.2 to 4.6, when I start evmserverd service, I have this error :

~~~
Oct 23 16:54:06 xyzwr1 sh: rake aborted!
Oct 23 16:54:06 xyzwr1 sh: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass:'ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite MiqWorker.inheritance_column to use another column for that information.
~~~


Version-Release number of selected component (if applicable):
cfme-5.7.4.2-1.el7cf.x86_64 to cfme-5.9.4.7-1.el7cf.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install cfme-4.2 appliance
2. Upgrade it to cfme-4.6
3. Start evm service

Actual results:
Getting following error:

~~~
Oct 23 16:54:06 xyzwr1 sh: rake aborted!
Oct 23 16:54:06 xyzwr1 sh: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass:'ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite MiqWorker.inheritance_column to use another column for that information.
~~~

Expected results:
Service should be up without any errors

Additional info:
After updating schema type to ManageIQ::Providers::AnsibleTower::AutomationManager::RefreshWorker, evm service is up and running:

~~~
MiqWorker.where(:type => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker").update_all(:type => "ManageIQ::Providers::AnsibleTower::AutomationManager::RefreshWorker")
~~~

Comment 3 Joe Rafaniello 2018-10-30 16:04:16 UTC
It looks like the worker name was renamed starting in fine but a migration wasn't written... cfme 5.8 / cf 4.5 here:

https://github.com/ManageIQ/manageiq/commit/2f0ef1a90758f2b5c37e93a0ed2f586a916dad64

Anyone upgrading from 5.7/4.2 that had used an ansible tower provider will probably hit this error.

To fix this, the database needs to be updated in the miq_workers table to either remove rows with the old name:

MiqWorker.where(:type => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker").destroy_all

Or rename it to the new name:

MiqWorker.where(:type => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker").update_all(:type => "ManageIQ::Providers::AnsibleTower::AutomationManager::RefreshWorker")

Comment 7 Marianne Feifer 2018-10-31 15:18:20 UTC
Please add this to migration guide based on the solution article referenced above.

Comment 9 Joe Rafaniello 2019-01-07 16:56:00 UTC
Note, a second worker class was removed without removing rows in miq_workers table and would have the same problem.

See bug 166195, where worker class ManageIQ::Providers::StorageManager::CinderManager::EventCatcher was removed.

Comment 10 Joe Rafaniello 2019-01-07 16:56:43 UTC
Wrong bug.  The correct bug for comment 9 is bug 1661957


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