Problem:
2022-01-31 05:29:29 [ERROR ] [configure] ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
2022-01-31 05:29:29 [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]
2022-01-31 05:29:51 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
2022-01-31 05:29:51 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: ‘/usr/sbin/foreman-rake db:migrate’ returned 1 instead of one of [0]
Expected outcome:
Clean install
Foreman and Proxy versions:
Foreman 3.1, Katello 4.3
Foreman and Proxy plugin versions:
Distribution and version:
CentOS 7
Other relevant data:
Fresh OS install
Data disks blank/formatted
Repos configred as per Install Docs
[root@katello ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.exabytes.com.my
* centos-sclo-rh: centos.exabytes.com.my
* epel: epel.mirror.angkasa.id
* extras: centos.exabytes.com.my
* updates: centos.exabytes.com.my
repo id repo name status
base/7/x86_64 CentOS-7 - Base 10,072
centos-sclo-rh/x86_64 CentOS-7 - SCLo rh 7,819
*epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,718
extras/7/x86_64 CentOS-7 - Extras 500
foreman/x86_64 Foreman 3.1 627
foreman-plugins/x86_64 Foreman plugins 3.1 406
katello/x86_64 Katello 4.3 102
katello-candlepin/x86_64 Candlepin: an open source entitlement management system. 4
pulpcore/x86_64 pulpcore: Fetch, Upload, Organize, and Distribute Software Packages. 222
puppet6/x86_64 Puppet 6 Repository el 7 - x86_64 335
updates/7/x86_64 CentOS-7 - Updates 3,369
repolist: 37,174
[root@katello ~]#
2022-01-31 05:17:35 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-01-31 05:17:40 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-01-31 05:17:40 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-01-31 05:21:44 [NOTICE] [configure] Starting system configuration.
2022-01-31 05:24:04 [NOTICE] [configure] 250 configuration steps out of 1808 steps complete.
2022-01-31 05:25:23 [NOTICE] [configure] 500 configuration steps out of 1808 steps complete.
2022-01-31 05:25:37 [NOTICE] [configure] 750 configuration steps out of 1810 steps complete.
2022-01-31 05:27:28 [NOTICE] [configure] 1000 configuration steps out of 1816 steps complete.
2022-01-31 05:27:35 [NOTICE] [configure] 1250 configuration steps out of 1834 steps complete.
2022-01-31 05:29:29 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-01-31 05:29:29 [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]
2022-01-31 05:29:51 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-01-31 05:29:51 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-01-31 05:30:03 [NOTICE] [configure] 1500 configuration steps out of 1834 steps complete.
2022-01-31 05:31:04 [NOTICE] [configure] 1750 configuration steps out of 1834 steps complete.
2022-01-31 05:31:28 [NOTICE] [configure] System configuration has finished.
There were errors detected during install.
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
I have also performed the install on a fresh CentOS 8 install and received the same errors. The CentOS 8 server then threw up a load more errors which the CentOS 7 systems hasn’t.
@Duncan_Innes seems like an Ansible issue to me even though you did not enabled ansible plugins. I am facing now a similar issue with db:migrate and haven’t figured it out yet
Not sure how clearing out all tasks can help in my case. This is a new install of Katello on a completely new OS install. There are no tasks in the database yet other than those which might have been created during the earlier installation phases.
Either by using Foreman::Plugin.installed?("foreman_ansible") (but no idea if that’s allowed in migrations) or checking something more specific, like ForemanAnsible::Engine or ForemanAnsible::VERSION
I have applied this patch to the current server, but it makes no change to the error. I also removed the OpenScap flags from the installer, but these may already be stored from previous runs.
I am performing an OS reinstall and will apply the patch to the new system before running foreman-installer.
After a few attempts, I’ve only managed to install Katello 4.3 by removing the openscap options from foreman_installer on a clean OS install. Looking back, I half expected this. But not sure why I couldn’t get the above patch to work.