ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.34k stars 897 forks source link

Bug: The single-table inheritance mechanism failed to locate the subclass: 'MiqEmsRefreshCoreWorker'. #22123

Open jrafanie opened 2 years ago

jrafanie commented 2 years ago

We found there was a missing worker class that was persisted in the miq_workers table but was subsequently removed in newer versions:

gems/activerecord-6.0.4.6/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class': The single-table inheritance mechanism failed to locate the subclass: 'MiqEmsRefreshCoreWorker'. 

https://github.com/ManageIQ/manageiq/pull/17196 removed this worker and the PRs: https://github.com/ManageIQ/manageiq-providers-vmware/pull/216 added MiqEmsRefreshCoreWorker and MiqVimBrokerWorker to the provider https://github.com/ManageIQ/manageiq-providers-vmware/pull/488 removed MiqEmsRefreshCoreWorker from the provider https://github.com/ManageIQ/manageiq-providers-vmware/pull/506 removed MiqVimBrokerWorker from the provider

We didn't write a migration to remove these rows from miq_workers leading to the reported issue.

Note, this code in the server is there to remove these unknown worker class rows at startup but because it's mixing "process killing" and "miq_workers row removal", it's only removing these unknown rows for the current/local server. Additionally, it seems problematic to kill valid worker rows for another server, especially if it's active. If you upgrade from one old version to another and old servers are not started on the new code, it will never clean them up.

TODO:

miq-bot commented 1 year ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.