Upgrade OS from debian 9 to 10

Hello,

I tried to upgrade my foreman server from debian 9 to 10. I didn’t get any error on the os side, but after upgrade foreman app was crashing returning web page error. It seems that the passenger app was crashing.

I’m running foreman 1.24.2 I know it is old, after os upgrade I’ll upgrade to supported version.

I was wondering is there any special steps to take care for OS side upgrade ?

Best regards

I have no experience with Foreman on Debian, but have you tried running foreman-installer again after the OS upgrade? I would assume some things changed from 9 to 10, and foreman-installer might be able to get you back up to a working configuration.

Hello,

indeed I run the command, but it somehow failed because during the upgrade process I was still suing postgresql 9.6 on debian 10. Maybe when I’m on debian 10 foreman require a postgresql 11 ? I found this weird because the foreman application doesn’t get upgraded.

Could you share the errors from foreman-installer and from when you try to start foreman? Maybe we can find some hints in there on where to start.

Foreman-installer failed because it expect postgresql 11 on debian 10.
I’ll copy the VM and run the upgrade again and provide the logs / error. Probably next week.

Thanks !

Hello,

I just deployed a copy of the VM.
After upgrade to debian 10 and staying with postgresql 9.6 I got in error.log file :

App 2153 stdout:
[ 2021-09-27 16:50:11.0089 861/7f18dc349700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/foreman: An error occured while starting the web application.
  Error ID: c3038faf
  Error details saved to: /tmp/passenger-error-WyFwlS.html
  Message from application: Did not recognize your adapter specification (cannot load such file -- oj/oj). (MultiJson::AdapterError)
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/lib/ruby/vendor_ruby/oj.rb:21:in `<top (required)>'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json/adapters/oj.rb:2:in `<top (required)>'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:157:in `load_adapter_from_string_name'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:101:in `load_adapter'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:103:in `load_adapter'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:91:in `use'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:73:in `adapter'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:133:in `current_adapter'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/multi_json-1.14.1/lib/multi_json.rb:139:in `dump'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/persistence_adapters/sequel.rb:381:in `dump_data'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/persistence_adapters/sequel.rb:269:in `prepare_record'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/persistence_adapters/sequel.rb:296:in `save'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/persistence_adapters/sequel.rb:209:in `insert_coordinator_record'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/coordinator_adapters/sequel.rb:12:in `create_record'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/coordinator.rb:352:in `create_record'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/coordinator.rb:383:in `register_world'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/world.rb:97:in `update_register'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/world.rb:58:in `initialize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/rails/configuration.rb:79:in `new'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/rails/configuration.rb:79:in `initialize_world'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/rails.rb:105:in `init_world'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-1.4.3/lib/dynflow/rails.rb:38:in `initialize!'
  /usr/share/foreman/config/application.rb:335:in `block in init_dynflow'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:42:in `block in call_event'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:41:in `each'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:41:in `call_event'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:393:in `before_handling_requests'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:134:in `negotiate_spawn_command'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'


[ 2021-09-27 16:50:11.0126 861/7f18dd44d700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 2-3] Cannot checkout session because a spawning error occurred. The identifier of the error is c3038faf. Please see earlier logs for details about the error.

When I try to run foreman-install return the following :

 /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]
 /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]
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:157:in `fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:168:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:626:in `refresh'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:147:in `process_callback'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:34:in `block in process_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:119:in `block in queued_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `queued_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:33:in `process_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:280:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:183:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:183:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:519:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:518:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:183:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:121:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:173:in `evaluate'
/usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:239:in `block (2 levels) in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:519:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:518:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:238:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:161:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:237:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:191:in `block (2 levels) in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:519:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:518:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:190:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:232:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:231:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:189:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:391:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:239:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:216:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:355:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block (2 levels) in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:280:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:263:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:233:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:174:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:690:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:139:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Installing             Done                                               [100%] [..........................................................................................................................................................]
  Something went wrong! Check the log for ERROR-level output

Hello,

I didn’t find any solution for this ruby error.
The only way I found is to upgrade foreman also. So the upgrade should look like this :

  • upgrade to debian 10
  • upgrade postgresql from 9.6 to 11
  • upgrade foreman from 1.24.2 to foreman 2.0.3

I would indeed recommend this as a proper solution.

1 Like