Problem: After running the do-release-upgrade command in Bionic (upgrade to Focal) Foreman does not start anymore. Or, the web UI tells We're sorry, but something went wrong.
The API seems to work already since we are fetching data from it.
Foreman and Proxy versions: 2.5
Foreman and Proxy plugin versions: 2.5
Distribution and version: Ubuntu 20.04 LTS x64
Other relevant data:
I’ve run the foreman-installer in noop mode to see if it complains about something but it was fine. The normal run offered:
[2022-10-19 09:30:01] /usr/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /usr/share/foreman/Gemfile.lock. (Gem::GemNotFoundException)
[2022-10-19 09:30:01] To update to the latest version installed on your system, run `bundle update --bundler`.
[2022-10-19 09:30:01] To install the missing version, run `gem install bundler:1.17.3`
[2022-10-19 09:30:01] from /usr/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
[2022-10-19 09:30:01] from /usr/bin/bundle:23:in `<main>'
So I’ve updated:
09:32]root@rmvm069:/usr/share/foreman# bundle update --bundler
Fetching gem metadata from https://rubygems.org/.........
Using bundler 2.1.4
I ran the foreman-installer again and it finished successfully.
But the web UI issue is still there. Now I found this error in the logs:
Please don’t update Bundler outside of the packages.
Can you please ensure all Foreman (and plugins) packages are installed from the right (focal) repository?
Worst case, force-reinstall all of them using apt install --reinstall <list of pkgs> (you should be able to get a rather succinct list using dpkg -l |grep foreman)
Here also the initial state before running apt commands and after the OS upgrade:
[13:19]root@rmvm069:~# dpkg -l | grep foreman
ii foreman 2.5.4-2 amd64 Systems management web interface
ii foreman-cli 2.5.4-2 all metapackage providing hammer CLI for Foreman
ii foreman-debug 2.5.4-2 all provides support utility foreman-debug.
ii foreman-dynflow-sidekiq 2.5.4-2 all package providing dynflow sidekiq services for Foreman
ii foreman-installer 2.5.4-1 all Automated puppet-based installer for The Foreman
ii foreman-postgresql 2.5.4-2 all metapackage providing PostgreSQL dependencies for Foreman
ii foreman-proxy 2.5.4-1 all RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii foreman-service 2.5.4-2 all package providing Foreman services running via puma
ii ruby-foreman-deface 1.5.3-1 all Foreman Deface Plugin Dependency
ii ruby-foreman-discovery 17.0.1-1 all Foreman Discovery Plugin
ii ruby-foreman-remote-execution 4.5.6-1 all Foreman Remote Execution Plugin
ii ruby-foreman-remote-execution-core 1.4.8-1 all Foreman remote execution - core bits
ii ruby-foreman-setup 6.0.0-1 all Foreman Setup Plugin
ii ruby-foreman-tasks 4.1.5-1 all Tasks management engine for Foreman.
ii ruby-foreman-tasks-core 0.3.6-1 all Foreman tasks - core bits
ii ruby-hammer-cli-foreman 2.5.0-1 all Foreman commands for Hammer
Cool, if you have snapshots, we can try a few things out
For me, the following seems to have worked correctly around the Bundler issue:
# vi /etc/apt/sources.list.d/foreman.list (uncomment the repos again, as d-r-u has disabled them, check it reads "focal" not "bionic"
# apt update
# cd /usr/share/foreman/
# bundle update --local --bundler
# apt install --reinstall foreman <and any other foreman packages>