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