Upgrade distro from Ubuntu 20.04 to Ubuntu 22.04

hi all,

we want to upgrade distro from Ubuntu 20.04 to Ubuntu 22.04, and in foreman.list are focal settings, and I know I have to change it to jammy, but what else do I have to do ?

thanks in advance
Regards
Neeloj

Normal upgrade from here (apt upgrade, foreman-installer), afterwards you probably want to upgrade your PostgreSQL from whatever was in Focal to whatever is in Jammy.

1 Like

thank you @evgeni so you mean:

vi foreman.list
deb http://deb.theforeman.org/ jammy 3.12
deb http://deb.theforeman.org/ plugins 3.12

apt update 
foreman-installer

the PostgreSQL was version 12 in Focal.

After I run above commands, I get below errors:

# foreman-installer
2025-07-14 12:49:49 [NOTICE] [root] Loading installer configuration. This will take some time.
2025-07-14 12:49:57 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2025-07-14 12:49:57 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2025-07-14 12:49:59 [NOTICE] [checks] System checks passed
Package versions are locked. Continuing with unlock.
2025-07-14 12:50:03 [NOTICE] [configure] Starting system configuration.
2025-07-14 12:50:44 [NOTICE] [configure] 250 configuration steps out of 1239 steps complete.
2025-07-14 12:50:45 [NOTICE] [configure] 500 configuration steps out of 1242 steps complete.
2025-07-14 12:50:45 [NOTICE] [configure] 750 configuration steps out of 1376 steps complete.
2025-07-14 12:50:52 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2025-07-14 12:50:52 [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]
2025-07-14 12:50:53 [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]
2025-07-14 12:50:53 [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]
2025-07-14 12:50:53 [NOTICE] [configure] 1000 configuration steps out of 1380 steps complete.
2025-07-14 12:51:13 [NOTICE] [configure] 1250 configuration steps out of 1380 steps complete.
2025-07-14 12:51:21 [ERROR ] [configure] Systemd start for foreman-proxy failed!
2025-07-14 12:51:21 [ERROR ] [configure] journalctl log for foreman-proxy:
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:13 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 12:51:21 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure: change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed!
2025-07-14 12:51:21 [ERROR ] [configure] journalctl log for foreman-proxy:
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:13 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 12:51:21 [ERROR ] [configure] Jul 14 12:51:14 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 12:51:25 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Exec resource 'foreman-rake-db:migrate' failed. Logs:
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]
    Adding autorequire relationship with User[foreman]
    Starting to evaluate the resource (940 of 1380)
    Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    Evaluated in 0.14 seconds
  Exec[foreman-rake-db:migrate](provider=posix)
    Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
    Executing '/usr/sbin/foreman-rake db:migrate'
    Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
    Executing '/usr/sbin/foreman-rake db:migrate'
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless
    /usr/bin/foreman-ruby: No such file or directory -- /usr/bin/bundle2.7 (LoadError)
    /usr/bin/foreman-ruby: No such file or directory -- /usr/bin/bundle2.7 (LoadError)
  /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns
    /usr/bin/foreman-ruby: No such file or directory -- /usr/bin/bundle2.7 (LoadError)
    change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    /usr/bin/foreman-ruby: No such file or directory -- /usr/bin/bundle2.7 (LoadError)
Error 2: Puppet Service resource 'foreman-proxy' failed. Logs:
  /Service[foreman-proxy]
    Starting to evaluate the resource (1319 of 1380)
    Evaluated in 8.61 seconds
  /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure
    change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed!
journalctl log for foreman-proxy:
Jul 14 12:51:13 srv-03 systemd[1]: Starting Foreman Proxy...
Jul 14 12:51:14 srv-03 smart-proxy[6708]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 12:51:14 srv-03 smart-proxy[6708]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 12:51:14 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
Jul 14 12:51:14 srv-03 systemd[1]: Failed to start Foreman Proxy.

2 errors were detected.
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/foreman.log

“apt update” or “apt upgrade”? the former doesn’t update any packages.

can you show us dpkg -l |grep foreman

here, I restore the snapshot and I tried again with apt update then apt upgrade then foreman-installer I get below error:

# foreman-installer
2025-07-14 13:23:37 [NOTICE] [root] Loading installer configuration. This will take some time.
2025-07-14 13:23:43 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2025-07-14 13:23:43 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2025-07-14 13:23:44 [NOTICE] [checks] System checks passed
Package versions are locked. Continuing with unlock.
2025-07-14 13:23:49 [NOTICE] [configure] Starting system configuration.
2025-07-14 13:24:17 [NOTICE] [configure] 250 configuration steps out of 1239 steps complete.
2025-07-14 13:24:18 [NOTICE] [configure] 500 configuration steps out of 1242 steps complete.
2025-07-14 13:24:18 [NOTICE] [configure] 750 configuration steps out of 1376 steps complete.
2025-07-14 13:25:03 [NOTICE] [configure] 1000 configuration steps out of 1380 steps complete.
2025-07-14 13:25:42 [NOTICE] [configure] 1250 configuration steps out of 1380 steps complete.
2025-07-14 13:25:50 [ERROR ] [configure] Systemd start for foreman-proxy failed!
2025-07-14 13:25:50 [ERROR ] [configure] journalctl log for foreman-proxy:
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:44 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:42 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 13:25:50 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure: change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed!
2025-07-14 13:25:50 [ERROR ] [configure] journalctl log for foreman-proxy:
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:44 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:22:45 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:42 srv-03 systemd[1]: Starting Foreman Proxy...
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
2025-07-14 13:25:50 [ERROR ] [configure] Jul 14 13:25:43 srv-03 systemd[1]: Failed to start Foreman Proxy.
2025-07-14 13:26:25 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Service resource 'foreman-proxy' failed. Logs:
  /Service[foreman-proxy]
    Starting to evaluate the resource (1319 of 1380)
    Evaluated in 8.85 seconds
  /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure
    change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed!
journalctl log for foreman-proxy:
Jul 14 13:22:44 srv-03 systemd[1]: Starting Foreman Proxy...
Jul 14 13:22:45 srv-03 smart-proxy[7339]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:22:45 srv-03 smart-proxy[7339]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 13:22:45 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
Jul 14 13:22:45 srv-03 systemd[1]: Failed to start Foreman Proxy.
Jul 14 13:25:42 srv-03 systemd[1]: Starting Foreman Proxy...
Jul 14 13:25:43 srv-03 smart-proxy[9967]: <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick/https (LoadError)
Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:8:in `<top (required)>'
Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
Jul 14 13:25:43 srv-03 smart-proxy[9967]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 13:25:43 srv-03 systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.
Jul 14 13:25:43 srv-03 systemd[1]: Failed to start Foreman Proxy.

1 error was detected during installation.
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/foreman.log

here the output for dpkg

# dpkg -l |grep foreman
ii  foreman                                3.12.1-1+ubuntu2204                     amd64        Systems management web interface
ii  foreman-cli                            3.12.1-1+ubuntu2204                     all          metapackage providing hammer CLI for Foreman
ii  foreman-debug                          3.12.1-1+ubuntu2204                     all          provides support utility foreman-debug.
ii  foreman-dynflow-sidekiq                3.12.1-1+ubuntu2204                     all          package providing dynflow sidekiq services for Foreman
ii  foreman-installer                      3.12.1-1+ubuntu2204                     all          Automated puppet-based installer for The Foreman
ii  foreman-postgresql                     3.12.1-1+ubuntu2204                     all          metapackage providing PostgreSQL dependencies for Foreman
ii  foreman-proxy                          3.12.1-1+ubuntu2204                     all          RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii  foreman-redis                          3.12.1-1+ubuntu2204                     all          metapackage providing redis dependencies for Foreman
ii  foreman-service                        3.12.1-1+ubuntu2204                     all          package providing Foreman services running via puma
ii  ruby-foreman-column-view               0.4.0-2                                 all          Foreman Column View Plugin
ii  ruby-foreman-deface                    1.9.0-2                                 all          Foreman Deface Plugin Dependency
ii  ruby-foreman-maintain                  1.7.6-1+ubuntu2204                      all          Foreman maintenance tool belt
ii  ruby-foreman-puppet                    7.0.0-1                                 all          Foreman Puppet Plugin
ii  ruby-hammer-cli-foreman                3.12.0-1+ubuntu2204                     all          Foreman commands for Hammer
ii  ruby-hammer-cli-foreman-puppet         0.1.0-1+ubuntu2204                      all          Foreman Puppet plugin for Hammer CLI

Ah, I think I remember, this could be jammy, bookworm: set ruby-webrick dependency to >= 1.7.0 by kenyon · Pull Request #11954 · theforeman/foreman-packaging · GitHub

Can you show us apt policy ruby-webrick please?

1 Like

here is the output of apt policy ruby-webrick

# apt policy ruby-webrick
ruby-webrick:
  Installiert:           (keine)
  Installationskandidat: 1.7.0-3ubuntu0.1
  Versionstabelle:
     1.7.0-3ubuntu0.1 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     1.7.0-3 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

yes its sounds like the PR:

" This breaks foreman-proxy when upgrading from Ubuntu 20.04 to 22.04, for example, since foreman-proxy uses ruby3.0."

Okay, apt install ruby-webrick and try again :slight_smile:

1 Like

it works :slight_smile: thank you so much, Du hast meinen Tag gerettet :-), last question please, do I have to do anyhtin with:

:/etc/postgresql# ll
total 28
drwxr-xr-x   5 postgres postgres  4096 Jul 14 13:24 ./
drwxr-xr-x 133 root     root     12288 Jul 14 13:24 ../
drwxr-xr-x   3 postgres postgres  4096 Sep 16  2021 10/
drwxr-xr-x   3 postgres postgres  4096 Aug 25  2022 12/
drwxr-xr-x   3 postgres postgres  4096 Jul 14 13:24 14/

so for all others:

  1. change the foreman.list to your distro ( ubuntu 22.04 here )
  2. apt update
  3. apt upgrade
  4. apt install ruby-webrick
  5. foreman-installer
# foreman-installer
2025-07-14 13:33:45 [NOTICE] [root] Loading installer configuration. This will take some time.
2025-07-14 13:33:51 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2025-07-14 13:33:51 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2025-07-14 13:33:52 [NOTICE] [checks] System checks passed
Package versions are locked. Continuing with unlock.
2025-07-14 13:33:56 [NOTICE] [configure] Starting system configuration.
2025-07-14 13:34:06 [NOTICE] [configure] 250 configuration steps out of 1239 steps complete.
2025-07-14 13:34:07 [NOTICE] [configure] 500 configuration steps out of 1242 steps complete.
2025-07-14 13:34:07 [NOTICE] [configure] 750 configuration steps out of 1376 steps complete.
2025-07-14 13:34:26 [NOTICE] [configure] 1000 configuration steps out of 1378 steps complete.
2025-07-14 13:34:26 [NOTICE] [configure] 1250 configuration steps out of 1378 steps complete.
2025-07-14 13:34:33 [NOTICE] [configure] System configuration has finished.
Executing: foreman-rake upgrade:run
Success!
* Foreman is running at https://srv-03..internal
* Foreman Proxy is running at https://srv-03..internal:8443
The full log is at /var/log/foreman-installer/foreman.log

t

1 Like

depends on your definition on “have to”.
You still have PostgreSQL 12 from Ubuntu 20.04 running.
You should upgrade that to 14 from 22.04.
But it doesn’t need to happen today :wink:

1 Like

I can create dump from 12 and restore it to 14 , but I need new schema, you are right…
which one will foreman now use 14 or 12 ?

I think you should be able to do something like pg_upgradecluster 12 main and done, but it’s been a while that I’ve done PostgreSQL on debian.

1 Like

when I restart the server foreman doesnt start automatically I get below error:

â—Ź foreman.service - Foreman
     Loaded: loaded (/lib/systemd/system/foreman.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/foreman.service.d
             └─installer.conf
     Active: activating (start) since Mon 2025-07-14 13:46:41 CEST; 6s ago
TriggeredBy: â—Ź foreman.socket
       Docs: https://theforeman.org
   Main PID: 8070 (foreman-ruby)
      Tasks: 2 (limit: 4558)
     Memory: 164.8M
        CPU: 5.855s
     CGroup: /system.slice/foreman.service
             └─8070 foreman-ruby /usr/share/foreman/bin/rails server --environment production

Jul 14 13:46:41 srv-03 systemd[1]: foreman.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 13:46:41 srv-03 systemd[1]: foreman.service: Failed with result 'exit-code'.
Jul 14 13:46:41 srv-03 systemd[1]: Failed to start Foreman.
Jul 14 13:46:41 srv-03 systemd[1]: foreman.service: Consumed 7.248s CPU time.
Jul 14 13:46:41 srv-03 systemd[1]: Starting Foreman...
Jul 14 13:46:46 srv-03 foreman[8070]: => Booting Puma
Jul 14 13:46:46 srv-03 foreman[8070]: => Rails 6.1.7.10 application starting in production
Jul 14 13:46:46 srv-03 foreman[8070]: => Run `bin/rails server --help` for more startup options
Jul 14 13:46:50 srv-03 foreman[8070]: Exiting
Jul 14 13:46:50 srv-03 foreman[8070]: /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adap>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/co>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/mo>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/at>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/mo>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/mo>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/mo>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/mo>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/app/services/graphql_attribute.rb:15:in `required?'
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/app/graphql/types/base_object.rb:55:in `nullable?'
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/app/graphql/types/base_object.rb:9:in `field'
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/app/graphql/types/base_object.rb:14:in `timestamps'
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/foreman_puppet-7.0.0/app/graphgl/foreman_p>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/foreman_puppet-7.0.0/app/graphgl/foreman_p>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/foreman_puppet-7.0.0/app/graphgl/foreman_p>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/foreman_puppet-7.0.0/app/graphgl/foreman_p>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `requ>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `requ>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:>
Jul 14 13:46:50 srv-03 foreman[8070]:         from /usr/share/foreman/vendor/ruby/3.0.0/gems/activesupport-6.1.7.10/lib/

The output is cut off, but I guess it’s starting Foreman before PostgreSQL and then fails?

1 Like

you are right after restart the server:

#systemctl status postgresql@12-main.service < – is stopped
#systemctl status postgresql@14-main.service <— is started

I stop the postgresql@14-main.service and start postgresql@12-main.service, I get UI now but with an error

 Service unavailable ERF64-6496 [Foreman::MaintenanceException]: There are migrations pending in the system.
# pg_upgradecluster 12 main
Error: target cluster 14/main already exists

Does it get fixed if you re-run the installer?
(There should be no pending migrations after installer is finished)

as you can see here I dont get any errors after I install the ruby-webrick and rerun foreman-installer

# foreman-installer
2025-07-14 13:33:45 [NOTICE] [root] Loading installer configuration. This will take some time.
2025-07-14 13:33:51 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2025-07-14 13:33:51 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2025-07-14 13:33:52 [NOTICE] [checks] System checks passed
Package versions are locked. Continuing with unlock.
2025-07-14 13:33:56 [NOTICE] [configure] Starting system configuration.
2025-07-14 13:34:06 [NOTICE] [configure] 250 configuration steps out of 1239 steps complete.
2025-07-14 13:34:07 [NOTICE] [configure] 500 configuration steps out of 1242 steps complete.
2025-07-14 13:34:07 [NOTICE] [configure] 750 configuration steps out of 1376 steps complete.
2025-07-14 13:34:26 [NOTICE] [configure] 1000 configuration steps out of 1378 steps complete.
2025-07-14 13:34:26 [NOTICE] [configure] 1250 configuration steps out of 1378 steps complete.
2025-07-14 13:34:33 [NOTICE] [configure] System configuration has finished.
Executing: foreman-rake upgrade:run
Success!
* Foreman is running at https://srv-03..internal
* Foreman Proxy is running at https://srv-03..internal:8443
The full log is at /var/log/foreman-installer/foreman.log

[/quote]

# pg_upgradecluster 12 main
Error: target cluster 14/main already exists

what I did I delete the pg_dropcluster 14 main --stop then I run pg_upgradecluster 12 main, after that I run foreman-rake db:migrate, this should be ok right ?

yeah, probably

1 Like

thanks @evgeni it works for me now, I did this:

pg_dropcluster 14 main --stop
pg_upgradecluster 12 main
pg_ctlcluster 14 main start
foreman-rake db:migrate
foreman-rake db:seed
foreman-rake tmp:cache:clear
foreman-rake db:sessions:clear
su - postgres -c 'vacuumdb --full --dbname=foreman'

is there a way to compare both databases before I delete the pg_dropcluster 14 main --stop then I can be sure that new columns, tables etc. are created.