Problem:
The upgrade from Forman 2.3.5 and Katello 3.18.5 to Foreman 2.4.1 and Katello 4.0 fails.
I followed the steps in Upgrading and Updating Foreman server
In short:
foreman-rake katello:upgrade_check
yum update -y
yum update -y https://yum.theforeman.org/releases/2.4/el7/x86_64/foreman-release.rpm
yum update -y https://yum.theforeman.org/katello/4.0/katello/el7/x86_64/katello-repos-latest.rpm
yum install -y centos-release-scl-rh
yum clean all
yum update -y
foreman-installer
Expected outcome:
Upgrade succeeds
Foreman and Proxy versions:
Foreman 2.3.5 and Katello 3.18.5
Foreman and Proxy plugin versions:
Distribution and version:
CentOS Linux release 7.9.2009
Other relevant data:
foreman-installer
[...]
2021-10-26 12:40:57 [NOTICE] [configure] 100 out of 2081 done.
2021-10-26 12:40:57 [NOTICE] [configure] 200 out of 2081 done.
2021-10-26 12:40:57 [NOTICE] [configure] 300 out of 2081 done.
2021-10-26 12:40:59 [NOTICE] [configure] 400 out of 2081 done.
2021-10-26 12:41:04 [NOTICE] [configure] 500 out of 2081 done.
2021-10-26 12:41:04 [NOTICE] [configure] 600 out of 2083 done.
2021-10-26 12:41:04 [NOTICE] [configure] 700 out of 2083 done.
2021-10-26 12:41:04 [NOTICE] [configure] 800 out of 2084 done.
2021-10-26 12:41:06 [NOTICE] [configure] 900 out of 2086 done.
2021-10-26 12:41:08 [NOTICE] [configure] 1000 out of 2087 done.
2021-10-26 12:41:10 [NOTICE] [configure] 1100 out of 2089 done.
2021-10-26 12:41:10 [NOTICE] [configure] 1200 out of 2116 done.
2021-10-26 12:41:13 [NOTICE] [configure] 1300 out of 2117 done.
2021-10-26 12:41:13 [NOTICE] [configure] 1400 out of 2118 done.
2021-10-26 12:42:37 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
2021-10-26 12:42:37 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
2021-10-26 12:42:37 [NOTICE] [configure] 1500 out of 2118 done.
2021-10-26 12:42:37 [NOTICE] [configure] 1600 out of 2118 done.
2021-10-26 12:42:37 [NOTICE] [configure] 1700 out of 2146 done.
2021-10-26 12:42:37 [NOTICE] [configure] 1800 out of 2146 done.
2021-10-26 12:42:38 [NOTICE] [configure] 1900 out of 2146 done.
2021-10-26 12:42:39 [NOTICE] [configure] 2000 out of 2146 done.
2021-10-26 12:42:59 [NOTICE] [configure] 2100 out of 2146 done.
2021-10-26 12:43:07 [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 don’t know if that’s helpful, but here is the output from the “db:seed” command.
If I run “foreman-rake db:seed --trace” with the version Foreman 2.3.5 and Katello 3.18.5, I got this message:
** Invoke db:seed (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke db:load_config
** Execute db:abort_if_pending_migrations
** Invoke dynflow:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute dynflow:abort_if_pending_migrations
User with login admin already exists, not seeding as admin.
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Remote execution features is invalid
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:53:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `block in save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:48:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.2.2/app/models/job_template.rb:68:in `import_raw!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:19:in `block (4 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:17:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:17:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:15:in `block (2 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:6:in `block in <top (required)>'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.1.1/db/seeds.d/75_job_templates.rb:5:in `<top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/usr/share/foreman/app/services/foreman_seeder.rb:46:in `block (2 levels) in execute'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/usr/share/foreman/app/services/foreman_seeder.rb:45:in `block in execute'
/usr/share/foreman/app/services/foreman_seeder.rb:39:in `each'
/usr/share/foreman/app/services/foreman_seeder.rb:39:in `execute'
/usr/share/foreman/db/seeds.rb:14:in `<top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.4/lib/rails/engine.rb:559:in `load_seed'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/tasks/database_tasks.rb:440:in `load_seed'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/railties/databases.rake:331:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:235:in `mon_synchronize'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:seed
After update the packages to Foreman/Katello 2.4.1/4.0 and run the installer I got this message from “foreman-rake db:seed --trace”:
** Invoke db:seed (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
** Execute db:load_config
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke db:load_config
** Execute db:abort_if_pending_migrations
** Invoke dynflow:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute dynflow:abort_if_pending_migrations
User with login admin already exists, not seeding as admin.
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Remote execution features is invalid
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:53:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `block in save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:48:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.3.0/app/models/job_template.rb:68:in `import_raw!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:19:in `block (4 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:17:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:17:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:15:in `block (2 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:6:in `block in <top (required)>'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.2.0/db/seeds.d/75_job_templates.rb:5:in `<top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/usr/share/foreman/app/services/foreman_seeder.rb:46:in `block (2 levels) in execute'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/usr/share/foreman/app/services/foreman_seeder.rb:45:in `block in execute'
/usr/share/foreman/app/services/foreman_seeder.rb:39:in `each'
/usr/share/foreman/app/services/foreman_seeder.rb:39:in `execute'
/usr/share/foreman/db/seeds.rb:14:in `<top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.4/lib/rails/engine.rb:559:in `load_seed'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/tasks/database_tasks.rb:440:in `load_seed'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.4/lib/active_record/railties/databases.rake:331:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:235:in `mon_synchronize'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:seed
Any helpful advice is appreciated, thanks for taking the time to read this!