Error updating from Foreman 3.1 to Foreman 3.2

Problem:
Upgrading from Foreman 3.1 to Foreman 3.2 on a Centos 7 “foreman-installer” fails with errors. The first is when it tries to start foreman. These are first error messages:

2022-03-22 13:25:38 [DEBUG ] [configure] Executing: '/bin/systemctl start -- foreman'
2022-03-22 13:25:41 [DEBUG ] [configure] Running journalctl command to get logs for systemd start failure: journalctl -n 50 --since '5 minutes ago' -u foreman --no-pager
2022-03-22 13:25:41 [DEBUG ] [configure] Executing: 'journalctl -n 50 --since '5 minutes ago' -u foreman --no-pager'
2022-03-22 13:25:41 [ERROR ] [configure] Systemd start for foreman failed!
2022-03-22 13:25:41 [ERROR ] [configure] journalctl log for foreman:
2022-03-22 13:25:41 [ERROR ] [configure] -- Logs begin at Tue 2022-03-22 12:52:12 CET, end at Tue 2022-03-22 13:25:41 CET. --
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: Exiting
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_setup-7.0.0/app/models/foreman_setup/provisioner.rb:6:in `<class:Provisioner>': uninitialized constant Host::Hostmix (NameError)
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: from /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_setup-7.0.0/app/models/foreman_setup/provisioner.rb:4:in `<module:ForemanSetup>'
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: from /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_setup-7.0.0/app/models/foreman_setup/provisioner.rb:3:in `<top (required)>'
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: from /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
2022-03-22 13:25:41 [ERROR ] [configure] Mar 22 13:20:41 puppet.terrassa.upc.edu foreman[29949]: from /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'

Expected outcome:
I’ve done the same procedure a lot of times, following manual indications with succes. This seems a bug in the installer.

Foreman and Proxy versions:
3.1 migrating to 3.2

Foreman and Proxy plugin versions:

3.1 migrating to 3.2

Distribution and version:

Other relevant data:

As I said, the foreman-installer fails starting “foreman” but also trying to start dynflow-sidekiq@orchestrator and dynflow-sidekiq@worker-1
Here is a brief of their start tries:

2022-03-22 13:25:42 [DEBUG ] [configure] Executing: ‘/bin/systemctl start – dynflow-sidekiq@orchestrator’
2022-03-22 13:25:43 [DEBUG ] [configure] Running journalctl command to get logs for systemd start failure: journalctl -n 50 --since ‘5 minutes ago’ -u dynflow-sidekiq@orchestrator --no-
pager
2022-03-22 13:25:43 [DEBUG ] [configure] Executing: ‘journalctl -n 50 --since ‘5 minutes ago’ -u dynflow-sidekiq@orchestrator --no-pager’
2022-03-22 13:25:43 [ERROR ] [configure] Systemd start for dynflow-sidekiq@orchestrator failed!
2022-03-22 13:25:43 [ERROR ] [configure] journalctl log for dynflow-sidekiq@orchestrator:
2022-03-22 13:25:43 [ERROR ] [configure] – Logs begin at Tue 2022-03-22 12:52:12 CET, end at Tue 2022-03-22 13:25:43 CET. –
2022-03-22 13:25:43 [ERROR ] [configure] Mar 22 13:20:45 puppet.terrassa.upc.edu dynflow-sidekiq@orchestrator[30898]: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-3.0.5/l
ib/foreman_puppet/register.rb:156: warning: already initialized constant Foreman::Plugin::RbacSupport::AUTO_EXTENDED_ROLES
2022-03-22 13:25:43 [ERROR ] [configure] Mar 22 13:20:45 puppet.terrassa.upc.edu dynflow-sidekiq@orchestrator[30898]: /usr/share/foreman/app/registries/foreman/plugin/rbac_support.rb:5:
warning: previous definition of AUTO_EXTENDED_ROLES was here
2022-03-22 13:25:43 [ERROR ] [configure] Mar 22 13:20:48 puppet.terrassa.upc.edu dynflow-sidekiq@orchestrator[30898]: uninitialized constant Host::Hostmix
2022-03-22 13:25:43 [ERROR ] [configure] Mar 22 13:20:48 puppet.terrassa.upc.edu dynflow-sidekiq@orchestrator[30898]: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_setup-7.0.0/ap
p/models/foreman_setup/provisioner.rb:6:in `class:Provisioner

2022-03-22 13:25:43 [DEBUG ] [configure] Executing: '/bin/systemctl start -- dynflow-sidekiq@worker-1'
2022-03-22 13:25:48 [DEBUG ] [configure] Running journalctl command to get logs for systemd start failure: journalctl -n 50 --since '5 minutes ago' -u dynflow-sidekiq@worker-1 --no-page
r
2022-03-22 13:25:48 [DEBUG ] [configure] Executing: 'journalctl -n 50 --since '5 minutes ago' -u dynflow-sidekiq@worker-1 --no-pager'
2022-03-22 13:25:48 [ERROR ] [configure] Systemd start for dynflow-sidekiq@worker-1 failed!
2022-03-22 13:25:48 [ERROR ] [configure] journalctl log for dynflow-sidekiq@worker-1:
2022-03-22 13:25:48 [ERROR ] [configure] -- Logs begin at Tue 2022-03-22 12:52:12 CET, end at Tue 2022-03-22 13:25:48 CET. --
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:49 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: 2022-03-22T12:20:49.069Z 31908 TID-oc0 INFO: GitLab reliable fetch acti
vated!
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:49 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: 2022-03-22T12:20:49.093Z 31908 TID-ob0 INFO: Booting Sidekiq 5.2.7 with
 redis options {:id=>"Sidekiq-server-PID-31908", :url=>"redis://localhost:6379/0"}
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:55 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-3.0.5/lib/f
oreman_puppet/register.rb:156: warning: already initialized constant Foreman::Plugin::RbacSupport::AUTO_EXTENDED_ROLES
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:55 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: /usr/share/foreman/app/registries/foreman/plugin/rbac_support.rb:5: war
ning: previous definition of AUTO_EXTENDED_ROLES was here
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:58 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: uninitialized constant Host::Hostmix
2022-03-22 13:25:48 [ERROR ] [configure] Mar 22 13:20:58 puppet.terrassa.upc.edu dynflow-sidekiq@worker-1[31908]: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_setup-7.0.0/app/mo
dels/foreman_setup/provisioner.rb:6:in `<class:Provisioner>

I think this is an incompatibility with the foreman_setup plugin that was introduced in

commit 47c9a48f5120cb1732a95a046335848ddbf93c43
Author: Leos Stejskal <lstejska@redhat.com>
Date:   Mon Nov 22 14:16:27 2021 +0100

    Fixes #33967 - Loading constants in initializers/active_record_extensions.rb

See Refactor #33967: Move basic ActiveRecord::Base custom extensions to ApplicationRecord - Foreman

There is a patch for foreman_setup: Remove HostMix include · theforeman/foreman_setup@e9a5593 · GitHub, but it wasn’t released yet.

1 Like

Can not believe it! It actually works just removing that line!
Thanks a log @evgeni , you saved my life :smiley:
And thanks for the quick response also!
Best regards!

Sometimes it is that easy :wink:

I’ll make sure this gets a release and into the repos, so others won’t hit it too.

Thanks for reporting

2 Likes

FWIW @lzap did release a fixed version and it has landed in both nightly and 3.2 repos, so everyone should be safe now :slight_smile:

1 Like