Bug #30901
REX features are being registered before migrations are run
Status:
Closed
Priority:
Normal
Assignee:
Category:
Foreman
Target version:
Fixed in Releases:
Found in Releases:
Description
It can happen that we are trying to register a feature with fields that don't exist in the db yet. If this happens, it fails with:
ActiveModel::UnknownAttributeError: unknown attribute 'proxy_selector_override' for RemoteExecutionFeature. /home/user/foreman_remote_execution/app/models/remote_execution_feature.rb:58:in `block in register' /home/user/foreman_remote_execution/app/models/remote_execution_feature.rb:54:in `register' /home/user/foreman_openscap/lib/foreman_openscap/engine.rb:193:in `block (2 levels) in <class:Engine>' /home/user/foreman/app/registries/foreman/plugin.rb:78:in `instance_eval' /home/user/foreman/app/registries/foreman/plugin.rb:78:in `register' /home/user/foreman_openscap/lib/foreman_openscap/engine.rb:49:in `block in <class:Engine>' /home/user/foreman/config/environment.rb:5:in `<main>' /home/user/.rbenv/versions/2.7.1/bin/bundle:23:in `load' /home/user/.rbenv/versions/2.7.1/bin/bundle:23:in `<main>' Tasks: TOP => db:migrate => db:load_config => environment (See full trace by running task with --trace)
Associated revisions
History
#1
Updated by The Foreman Bot almost 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_remote_execution/pull/536 added
#2
Updated by The Foreman Bot almost 2 years ago
- Fixed in Releases added
#3
Updated by Anonymous almost 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_plugin|0bb4388d89f5d9968d580a196aaff7d5ea972cce.
#4
Updated by Adam Ruzicka almost 2 years ago
- Fixed in Releases foreman_remote_execution 4.2.0 added
- Fixed in Releases deleted (
)
Fixes #30901 - don't register features while migrations pending
It could happen that we were trying to register a feature with fields which
didn't have their corresponding columns in the db yet, even when running
migrations. With this change we skip the registration if there are any pending
migrations for REX.