I'm running Foreman 3.3 in EL 7, trying to upgrade foreman from 3.3 to 3.4

i’m running Foreman 3.3 in EL 7, trying to upgrade foreman from 3.3 to 3.4.

Not able to do as https://yum.theforeman.org/releases/3.4/el7/x86_64/foreman-release.rpm and https://yum.theforeman.org/katello/4.6/katello/el7/x86_64/katello-repos-latest.rpm are not available, looks like it’s available for EL8.

Is there any document to follow for upgrading OS from EL 7 to 8 and then upgrade foreman 3.3 to 3.4?

Thanks in advance.!

Yes.
While on 3.3, upgrade EL7 to EL8 using the docs: Upgrading and Updating Foreman

Then do a normal 3.3 to 3.4 upgrade.

1 Like

thank you, should i follow the same document for Smart proxy server running in EL7?

Yes.

1 Like

Upgrade EL7 to EL8 completed.

Now i’m trying to upgrade foreman from 3.3 to 3.4. Getting an error while run installer.

# foreman-installer
2022-09-15 11:37:49 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-09-15 11:37:53 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-09-15 11:37:53 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-09-15 11:37:59 [NOTICE] [configure] Starting system configuration.
2022-09-15 11:38:10 [NOTICE] [configure] 250 configuration steps out of 1795 steps complete.
2022-09-15 11:38:14 [NOTICE] [configure] 500 configuration steps out of 1795 steps complete.
2022-09-15 11:38:16 [NOTICE] [configure] 750 configuration steps out of 1800 steps complete.
2022-09-15 11:38:17 [NOTICE] [configure] 1250 configuration steps out of 1807 steps complete.
2022-09-15 11:39:08 [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]
2022-09-15 11:39:08 [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]
2022-09-15 11:39:08 [NOTICE] [configure] 1500 configuration steps out of 1807 steps complete.
2022-09-15 11:39:16 [NOTICE] [configure] 1750 configuration steps out of 1807 steps complete.
2022-09-15 11:39:19 [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

Below is the db:seed trace output.

# foreman-rake db:seed --trace
Rubocop not loaded.
** Invoke db:seed (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
ActiveModel::UnknownAttributeError: unknown attribute 'description' for Setting::DefaultHostgroup.
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `each'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/usr/share/gems/gems/activemodel-6.1.6.1/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/core.rb:518:in `initialize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/inheritance.rb:72:in `new'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/persistence.rb:37:in `create'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `block (2 levels) in load_defaults'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `each'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:16:in `block in load_defaults'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.6.1/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/foreman_default_hostgroup-6.0.0/app/models/setting/default_hostgroup.rb:11:in `load_defaults'
/usr/share/foreman/app/services/setting_registry.rb:114:in `each'
/usr/share/foreman/app/services/setting_registry.rb:114:in `load'
/usr/share/foreman/config/initializers/foreman.rb:37:in `block in <top (required)>'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `instance_exec'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `catch'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:199:in `block in halting'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `each'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:512:in `invoke_before'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:105:in `run_callbacks'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:88:in `prepare!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `instance_exec'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `block in run'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:17:in `benchmark'
/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `run'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/share/ruby/tsort.rb:228:in `block in tsort_each'
/usr/share/ruby/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/share/ruby/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/share/ruby/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/share/ruby/tsort.rb:347:in `each'
/usr/share/ruby/tsort.rb:347:in `call'
/usr/share/ruby/tsort.rb:347:in `each_strongly_connected_component'
/usr/share/ruby/tsort.rb:226:in `tsort_each'
/usr/share/ruby/tsort.rb:205:in `tsort_each'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in `run_initializers'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:391:in `initialize!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:367:in `require_environment!'
/usr/share/gems/gems/railties-6.1.6.1/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:seed => db:load_config => environment

Hmm, it seems the Default Hostgroup plugin is not compatible with 3.4 yet.

cc @Marek_Hulan

i tried to disable foreman_plugin_default_hostgroup, but getting the same error, hence i restored foreman from backup, and disabled foreman_plugin_default_hostgroup.
Now tried upgrade, getting same error even after disable the plugin.

foreman-installer --help | grep -i Hostgroup
–[no-]enable-foreman-plugin-default-hostgroup Enable ‘foreman_plugin_default_hostgroup’ puppet module (default: false)
= Module foreman_plugin_default_hostgroup:
–foreman-plugin-default-hostgroup-hostgroups An array of hashes of hostgroup names and facts to add to the configuration (current: )

How did you disable it? Removing the package and telling the installer is usually not sufficient, as there are still DB entries of the plugin.

disabled using the installer

foreman-installer --no-enable-foreman-plugin-default-hostgroup

Below done and the upgrade completed successfully.

disabled the plugin using the installer
foreman-installer --no-enable-foreman-plugin-default-hostgroup

I uninstalled rubygem-foreman_default_hostgroup package

ran foreman-rake db:seed

Performed upgrade. Looks good, thanks.

It seems another plugin has been hit by the settings change, see the other thread where other two plugins were identified. There’s no good solution atm.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.