Foreman-installer --scenario katello: [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

Problem:

foreman-installer --scenario katello
2024-12-09 09:57:50 [NOTICE] [root] Loading installer configuration. This will take some time.
2024-12-09 09:57:53 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2024-12-09 09:57:53 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2024-12-09 09:57:55 [NOTICE] [checks] System checks passed
2024-12-09 09:57:57 [NOTICE] [configure] Starting system configuration.
2024-12-09 09:58:05 [NOTICE] [configure] 250 configuration steps out of 1329 steps complete.
2024-12-09 09:58:06 [NOTICE] [configure] 500 configuration steps out of 1331 steps complete.
2024-12-09 09:58:09 [NOTICE] [configure] 750 configuration steps out of 1337 steps complete.
2024-12-09 09:58:09 [NOTICE] [configure] 1000 configuration steps out of 1339 steps complete.
2024-12-09 09:58:24 [ERROR ] [configure] ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
2024-12-09 09:58:24 [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-12-09 09:58:42 [NOTICE] [configure] 1250 configuration steps out of 1339 steps complete.
2024-12-09 09:58:46 [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 (1083 of 1339)
Evaluated in 14.30 seconds
Execforeman-rake-db:migrate
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!
Zeitwerk::NameError: expected file /usr/share/gems/gems/foreman-tasks-9.2.3/app/lib/actions/middleware/keep_current_request_id.rb to define constant Actions::Middleware::KeepCurrentRequestId, but didn’t

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 (1083 of 1339)
Failed to call refresh: ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
Evaluated in 28.17 seconds

Expected outcome:
I expect it run smoothly, RC 0

Foreman and Proxy versions:
rpm -qa | grep -E “^foreman|^katello” | sort
foreman-3.13.0-1.el9.noarch
foreman-cli-3.13.0-1.el9.noarch
foreman-dynflow-sidekiq-3.13.0-1.el9.noarch
foreman-installer-3.13.0-1.el9.noarch
foreman-installer-katello-3.13.0-1.el9.noarch
foreman-postgresql-3.13.0-1.el9.noarch
foreman-proxy-3.13.0-1.el9.noarch
foreman-redis-3.13.0-1.el9.noarch
foreman-release-3.13.0-1.el9.noarch
foreman-selinux-3.12.0-1.el9.noarch
foreman-service-3.13.0-1.el9.noarch
katello-4.15.0-1.el9.noarch
katello-certs-tools-2.10.0-1.el9.noarch
katello-client-bootstrap-1.7.9-2.el9.noarch
katello-common-4.15.0-1.el9.noarch
katello-repos-4.15.0-1.el9.noarch
katello-selinux-5.0.2-1.el9.noarch

Foreman and Proxy plugin versions:

Distribution and version:
cat /etc/os-release
NAME=“Red Hat Enterprise Linux”
VERSION=“9.4 (Plow)”
ID=“rhel”
ID_LIKE=“fedora”
VERSION_ID=“9.4”
PLATFORM_ID=“platform:el9”
PRETTY_NAME=“Red Hat Enterprise Linux 9.4 (Plow)”
ANSI_COLOR=“0;31”
LOGO=“fedora-logo-icon”
CPE_NAME=“cpe:/o:redhat:enterprise_linux:9::baseos”
HOME_URL=“https://www.redhat.com/
DOCUMENTATION_URL=“Red Hat Enterprise Linux | Red Hat Product Documentation
BUG_REPORT_URL=“https://issues.redhat.com/

REDHAT_BUGZILLA_PRODUCT=“Red Hat Enterprise Linux 9”
REDHAT_BUGZILLA_PRODUCT_VERSION=9.4
REDHAT_SUPPORT_PRODUCT=“Red Hat Enterprise Linux”
REDHAT_SUPPORT_PRODUCT_VERSION=“9.4”

Other relevant data:
Running with defaults so far, no changes, error repeats every time I exec the installer

1 Like

This should be resolved in rubygem-foreman_tasks-10.0.0, which is available in 3.13 repos. Where’s the 9.2.3 that you have there coming from?

1 Like

Ahoj Adam!

I managed indeed to upgrade backdated packages, after that the installer did run fine, I am sorry for opening a support case too fast.

Downloading Packages:
(1/38): rubygem-actionmailbox-6.1.7.10-1.el9.noarch.rpm
(2/38): rubygem-actioncable-6.1.7.10-1.el9.noarch.rpm
(3/38): rubygem-actionmailer-6.1.7.10-1.el9.noarch.rpm
(4/38): rubygem-actionpack-6.1.7.10-1.el9.noarch.rpm
(5/38): rubygem-actiontext-6.1.7.10-1.el9.noarch.rpm
(6/38): foreman-selinux-3.13.0-0.1.rc1.el9.noarch.rpm
(7/38): rubygem-actionview-6.1.7.10-1.el9.noarch.rpm
(8/38): rubygem-activejob-6.1.7.10-1.el9.noarch.rpm
(9/38): rubygem-activemodel-6.1.7.10-1.el9.noarch.rpm
(10/38): rubygem-activestorage-6.1.7.10-1.el9.noarch.rpm
(11/38): rubygem-activesupport-6.1.7.10-1.el9.noarch.rpm
(12/38): rubygem-excon-0.112.0-1.el9.noarch.rpm
(13/38): rubygem-activerecord-6.1.7.10-1.el9.noarch.rpm
(14/38): rubygem-facter-4.10.0-1.el9.noarch.rpm
(15/38): rubygem-foreman_maintain-1.8.1-2.el9.noarch.rpm
(16/38): rubygem-hammer_cli-3.13.0-1.el9.noarch.rpm
(17/38): rubygem-http-cookie-1.0.7-1.el9.noarch.rpm
(18/38): rubygem-i18n-1.14.6-1.el9.noarch.rpm
(19/38): rubygem-jwt-2.9.3-1.el9.noarch.rpm
(20/38): rubygem-ldap_fluff-0.8.0-1.el9.noarch.rpm
(21/38): rubygem-loofah-2.23.1-1.el9.noarch.rpm
(22/38): rubygem-hammer_cli_foreman-3.13.0-1.el9.noarch.rpm
(23/38): rubygem-msgpack-1.7.3-1.el9.x86_64.rpm
(24/38): rubygem-mime-types-data-3.2024.0903-1.el9.noarch.rpm
(25/38): rubygem-net-ssh-7.3.0-1.el9.noarch.rpm
(26/38): rubygem-nio4r-2.7.4-1.el9.x86_64.rpm
(27/38): rubygem-pg-1.5.9-1.el9.x86_64.rpm
(28/38): rubygem-puma-6.4.3-1.el9.x86_64.rpm
(29/38): rubygem-rails-6.1.7.10-1.el9.noarch.rpm
(30/38): rubygem-parallel-1.26.3-1.el9.noarch.rpm
(31/38): rubygem-rails-i18n-7.0.10-1.el9.noarch.rpm
(32/38): rubygem-railties-6.1.7.10-1.el9.noarch.rpm
(33/38): rubygem-webrick-1.9.0-1.el9.noarch.rpm
(34/38): rubygem-sequel-5.86.0-1.el9.noarch.rpm
(35/38): rubygem-zeitwerk-2.6.18-1.el9.noarch.rpm
(36/38): rubygem-smart_proxy_pulp-3.4.0-1.fm3_13.el9.noarch.rpm
(37/38): rubygem-foreman_remote_execution-14.0.2-1.fm3_13.el9.noarch.rpm
(38/38): rubygem-foreman-tasks-10.0.1-1.fm3_13.el9.noarch.rpm

The LOG:

foreman-installer --scenario katello
2024-12-09 10:09:55 [NOTICE] [root] Loading installer configuration. This will take some time.
2024-12-09 10:09:58 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2024-12-09 10:09:58 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2024-12-09 10:10:00 [NOTICE] [checks] System checks passed
2024-12-09 10:10:02 [NOTICE] [configure] Starting system configuration.
2024-12-09 10:10:10 [NOTICE] [configure] 250 configuration steps out of 1329 steps complete.
2024-12-09 10:10:11 [NOTICE] [configure] 500 configuration steps out of 1331 steps complete.
2024-12-09 10:10:14 [NOTICE] [configure] 750 configuration steps out of 1337 steps complete.
2024-12-09 10:10:14 [NOTICE] [configure] 1000 configuration steps out of 1339 steps complete.
2024-12-09 10:13:04 [NOTICE] [configure] 1250 configuration steps out of 1339 steps complete.
2024-12-09 10:13:15 [NOTICE] [configure] System configuration has finished.
Executing: foreman-rake upgrade:run

Upgrade Step 1/11: katello:correct_repositories. This may take a long while.

Upgrade Step 2/11: katello:clean_backend_objects. This may take a long while.
0 orphaned consumer id(s) found in candlepin.
Candlepin orphaned consumers:

Upgrade Step 3/11: katello:upgrades:4.0:remove_ostree_puppet_content. =============================================
Upgrade Step 4/11: katello:upgrades:4.1:sync_noarch_content. =============================================
Upgrade Step 5/11: katello:upgrades:4.1:fix_invalid_pools. I, [2024-12-09T10:13:29.411033 #11532] INFO – : Corrected 0 invalid pools
I, [2024-12-09T10:13:29.411101 #11532] INFO – : Removed 0 orphaned pools

Upgrade Step 6/11: katello:upgrades:4.1:reupdate_content_import_export_perms. =============================================
Upgrade Step 7/11: katello:upgrades:4.2:remove_checksum_values. =============================================
Upgrade Step 8/11: katello:upgrades:4.4:publish_import_cvvs. =============================================
Upgrade Step 9/11: katello:upgrades:4.8:fix_incorrect_providers. Fixing incorrect providers
Fixed 0 incorrect providers
Cleaning Candlepin orphaned custom products for organization Default Organization
Deleted 0 Candlepin orphaned custom products for organization Default Organization

Upgrade Step 10/11: katello:upgrades:4.8:regenerate_imported_repository_metadata. No repositories found for regeneration.

Upgrade Step 11/11: katello:upgrades:4.12:update_content_access_modes. Checking Candlepin status
Setting content access modes

Set content access mode for 0 organizations

Success!

The full log is at /var/log/foreman-installer/katello.log

echo $?
0

1 Like

No problem, glad to hear you got it working

2 Likes