Problem:
Unable to foreman-installer.log (1.8 KB) katello.log (2.5 MB)
install plugin foreman_rh_cloud (package rubygem-foreman_rh_cloud) for uploading inventory to RedHat Cloud Console. Foreman-installer ended with error:
2023-09-14 16:33:25 [ERROR ] [configure] ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
2023-09-14 16:33:25 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from ‘notrun’ to [‘0’] failed: ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
Expected outcome:
Succesfull installation of foreman_rh_cloud (package rubygem-foreman_rh_cloud) or providing of alternate process for inventory upload to RedHat Cloud Console.
Foreman and Proxy versions:
foreman-3.6.2-1.el8.noarch
katello-4.8.4-1.el8.noarch
Foreman and Proxy plugin versions:
Distribution and version:
RHEL 8.8
Other relevant data:
Problem started during “foreman-rake-db:migrate”
2023-09-14 16:33:24 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: rake aborted!
2023-09-14 16:33:24 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: StandardError: An error has o
ccurred, this and all later migrations canceled:
2023-09-14 16:33:24 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
2023-09-14 16:33:24 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::UndefinedColumn: ERROR: column settings.category does not exist
2023-09-14 16:33:24 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: LINE 1: … IN (SELECT “settings”.“id” FROM “settings” WHERE “settings”…
Still not fixed in rubygem-foreman_rh_cloud-7.0.45-1.fm3_6.el8.noarch.rpm
# cat /usr/share/gems/gems/foreman_rh_cloud-7.0.45/db/migrate/20221102110254_fix_rh_cloud_settings_category_to_dsl.rb
# frozen_string_literal: true
class FixRhCloudSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
def up
Setting.where(category: 'Setting::RhCloud').update_all(category: 'Setting')
end
end
What is the expected release without this bug? Solution is know from January 26, 2023.
Unfortunately plugin installation fails also with manual fix in 20221102110254_fix_rh_cloud_settings_category_to_dsl.rb
class FixRhCloudSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
def up
Setting.where(category: 'Setting::RhCloud').update_all(category: 'Setting') if column_exists?(:settings, :category)
end
end
I was able get rid of original error message “PG::UndefinedColumn: ERROR: column settings.category does not exist” but foreman-installer still fails.
2023-09-19 16:29:53 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2023-09-19 16:29:53 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2023-09-19 16:29:53 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Evaluated in 4.83 seconds
Well there is no point upgrading Katello, because its still broken in Foreman 3.12 / Katello 4.14
I’ve just upgraded from 3.9 through to 3.12, overcoming other bug due to postgresql locale to have a 3.12/4.14 server that is in perfect shape.
But rubygem-foreman_rh_cloud-10.0.2-1.fm3_12.el8.noarch is still broken, and installing this plugin fails with:
# foreman-installer --enable-foreman-plugin-rh-cloud
2024-10-30 17:44:11 [NOTICE] [root] Loading installer configuration. This will take some time.
2024-10-30 17:44:26 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2024-10-30 17:44:26 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2024-10-30 17:44:56 [NOTICE] [configure] Starting system configuration.
2024-10-30 17:45:28 [NOTICE] [configure] 250 configuration steps out of 1432 steps complete.
2024-10-30 17:45:30 [NOTICE] [configure] 500 configuration steps out of 1434 steps complete.
2024-10-30 17:46:04 [NOTICE] [configure] 750 configuration steps out of 1438 steps complete.
2024-10-30 17:46:05 [NOTICE] [configure] 1000 configuration steps out of 1442 steps complete.
2024-10-30 17:46:15 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-30 17:46:15 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2024-10-30 17:46:19 [NOTICE] [configure] 1250 configuration steps out of 1442 steps complete.
2024-10-30 17:46:35 [NOTICE] [configure] System configuration has finished.
Error 1: Puppet Exec resource 'foreman-rake-db:migrate' failed. Logs:
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]
Adding autorequire relationship with User[foreman]
Starting to evaluate the resource (1190 of 1442)
Evaluated in 8.15 seconds
Exec[foreman-rake-db:migrate](provider=posix)
Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
Executing '/usr/sbin/foreman-rake db:migrate'
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless
rake aborted!
Gem loading error: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/output.rb:13:in `strict_err'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:46:in `rescue in block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:39:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
Gem::MissingSpecError: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
Gem::MissingSpecError: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
LoadError: cannot load such file -- foreman_rh_cloud
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns
rake aborted!
Gem loading error: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/output.rb:13:in `strict_err'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:46:in `rescue in block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:39:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
Gem::MissingSpecError: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
Gem::MissingSpecError: Could not find 'foreman_ansible' (>= 0) among 250 total gem(s)
Checked in 'GEM_PATH=/usr/share/foreman/.gem/ruby:/usr/share/gems:/usr/local/share/gems', execute `gem env` for more information
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
LoadError: cannot load such file -- foreman_rh_cloud
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.8/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:36:in `<top (required)>'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
1 error was detected during installation.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.
The full log is at /var/log/foreman-installer/katello.log
Can you try running the installer with foreman-installer --scenario katello --enable-foreman-plugin-tasks --enable-foreman-plugin-ansible and see if it gets you past the error?