Foreman does not start after OS upgrade

I am pretty sure they were not. Foreman was running on 18.04 then we did the release upgrade. But I am not in panic since I have snapshots of this VM and go back easily.

@evgeni The bundler error message also appears when I try to reinstall from the focal repos.

[13:20]root@rmvm069:~# apt install --reinstall foreman foreman-cli foreman-debug foreman-dynflow-sidekiq foreman-installer foreman-postgresql foreman-proxy foreman-service ruby-foreman-deface ruby-foreman-discovery ruby-foreman-remote-execution ruby-foreman-remote-execution-core ruby-foreman-setup ruby-foreman-tasks ruby-foreman-tasks-core ruby-hammer-cli-foreman
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-certifi python-cffi-backend python-chardet python-cryptography python-enum34 python-idna python-ipaddress python-openssl
  python-pkg-resources python-six
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
  ruby-hammer-cli-foreman
1 upgraded, 0 newly installed, 15 reinstalled, 0 to remove and 7 not upgraded.
Need to get 77,6 MB/87,8 MB of archives.
After this operation, 1.024 B disk space will be freed.
Get:1 http://deb.theforeman.org focal/2.5 amd64 ruby-hammer-cli-foreman all 2.5.0-1 [84,3 kB]
Get:2 http://deb.theforeman.org focal/2.5 amd64 ruby-foreman-remote-execution-core all 1.4.8-1 [13,1 kB]
Get:3 http://deb.theforeman.org focal/2.5 amd64 ruby-foreman-tasks-core all 0.3.6-1 [10,3 kB]
Get:4 http://deb.theforeman.org focal/2.5 amd64 foreman amd64 2.5.4-2 [77,3 MB]
Get:5 http://deb.theforeman.org focal/2.5 amd64 foreman-proxy all 2.5.4-1 [89,0 kB]
Get:6 http://deb.theforeman.org plugins/2.5 amd64 ruby-foreman-deface all 1.5.3-1 [69,3 kB]
Get:7 http://deb.theforeman.org plugins/2.5 amd64 ruby-foreman-setup all 6.0.0-1 [49,7 kB]
Fetched 77,6 MB in 5s (16,5 MB/s)        
(Reading database ... 166222 files and directories currently installed.)
Preparing to unpack .../00-ruby-hammer-cli-foreman_2.5.0-1_all.deb ...
Unpacking ruby-hammer-cli-foreman (2.5.0-1) over (2.5.0-1) ...
Preparing to unpack .../01-foreman-cli_2.5.4-2_all.deb ...
Unpacking foreman-cli (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../02-foreman-installer_2.5.4-1_all.deb ...
Unpacking foreman-installer (2.5.4-1) over (2.5.4-1) ...
Preparing to unpack .../03-ruby-foreman-remote-execution-core_1.4.8-1_all.deb ...
Unpacking ruby-foreman-remote-execution-core (1.4.8-1) over (1.4.8-1) ...
Preparing to unpack .../04-ruby-foreman-tasks-core_0.3.6-1_all.deb ...
Unpacking ruby-foreman-tasks-core (0.3.6-1) over (0.3.6-1) ...
Preparing to unpack .../05-foreman_2.5.4-2_amd64.deb ...
Failed to stop dynflowd.service: Unit dynflowd.service not loaded.
invoke-rc.d: initscript dynflowd, action "stop" failed.
Unpacking foreman (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../06-foreman-debug_2.5.4-2_all.deb ...
Unpacking foreman-debug (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../07-foreman-dynflow-sidekiq_2.5.4-2_all.deb ...
Unpacking foreman-dynflow-sidekiq (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../08-foreman-postgresql_2.5.4-2_all.deb ...
Unpacking foreman-postgresql (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../09-foreman-proxy_2.5.4-1_all.deb ...
Unpacking foreman-proxy (2.5.4-1) over (2.5.4-1) ...
Preparing to unpack .../10-foreman-service_2.5.4-2_all.deb ...
Unpacking foreman-service (2.5.4-2) over (2.5.4-2) ...
Preparing to unpack .../11-ruby-foreman-deface_1.5.3-1_all.deb ...
Unpacking ruby-foreman-deface (1.5.3-1) over (1.5.3-1) ...
Preparing to unpack .../12-ruby-foreman-discovery_17.0.1-1_all.deb ...
Unpacking ruby-foreman-discovery (17.0.1-1) over (17.0.1-1) ...
Preparing to unpack .../13-ruby-foreman-remote-execution_4.5.6-1_all.deb ...
Unpacking ruby-foreman-remote-execution (4.5.6-1) over (4.5.6-1) ...
Preparing to unpack .../14-ruby-foreman-setup_6.0.0-1_all.deb ...
Unpacking ruby-foreman-setup (6.0.0-1) over (6.0.0-1) ...
Preparing to unpack .../15-ruby-foreman-tasks_4.1.5-1_all.deb ...
Unpacking ruby-foreman-tasks (4.1.5-1) over (4.1.5-1) ...
Setting up foreman-debug (2.5.4-2) ...
Setting up ruby-hammer-cli-foreman (2.5.0-1) ...
Setting up foreman (2.5.4-2) ...
Traceback (most recent call last):
	2: from /usr/bin/bundle:23:in `<main>'
	1: from /usr/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/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::G
emNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
dpkg: error processing package foreman (--configure):
 installed foreman package post-installation script subprocess returned error exit status 1
Setting up ruby-foreman-tasks-core (0.3.6-1) ...
dpkg: dependency problems prevent configuration of foreman-service:
 foreman-service depends on foreman (= 2.5.4-2); however:
  Package foreman is not configured yet.

dpkg: error processing package foreman-service (--configure):
 dependency problems - leaving unconfigured
Setting up foreman-installer (2.5.4-1) ...
dpkg: dependency problems prevent configuration of ruby-foreman-discovery:
 ruby-foreman-discovery depends on foreman (>= 1.24.0~rc1); however:
  Package foreman is not configured yet.

dpkg: error processing package ruby-foreman-discovery (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ruby-foreman-tasks:
 ruby-foreman-tasks depends on foreman (>= 2.4.0~rc1); however:
  Package foreman is not configured yet.

dpkg: error processing package ruby-foreman-tasks (--configure):
 dependency problems - leaving unconfigured
Setting up foreman-proxy (2.5.4-1) ...
Setting up foreman-cli (2.5.4-2) ...
dpkg: dependency problems prevent configuration of ruby-foreman-deface:
 ruby-foreman-deface depends on foreman; however:
  Package foreman is not configured yet.

dpkg: error processing package ruby-foreman-deface (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ruby-foreman-setup:
 ruby-foreman-setup depends on foreman (>= 1.13.0~rc1); however:
  Package foreman is not configured yet.

dpkg: error processing package ruby-foreman-setup (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ruby-foreman-remote-execution:
 ruby-foreman-remote-execution depends on foreman (>= 1.25.0~rc1); however:
  Package foreman is not configured yet.
 ruby-foreman-remote-execution depends on ruby-foreman-tasks (>= 0.15.1); however:
  Package ruby-foreman-tasks is not configured yet.
 ruby-foreman-remote-execution depends on ruby-foreman-deface; however:
  Package ruby-foreman-deface is not configured yet.

dpkg: error processing package ruby-foreman-remote-execution (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of foreman-postgresql:
 foreman-postgresql depends on foreman (= 2.5.4-2); however:
  Package foreman is not configured yet.

dpkg: error processing package foreman-postgresql (--configure):
 dependency problems - leaving unconfigured
Setting up ruby-foreman-remote-execution-core (1.4.8-1) ...
dpkg: dependency problems prevent configuration of foreman-dynflow-sidekiq:
 foreman-dynflow-sidekiq depends on foreman (= 2.5.4-2); however:
  Package foreman is not configured yet.

dpkg: error processing package foreman-dynflow-sidekiq (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 foreman
 foreman-service
 ruby-foreman-discovery
 ruby-foreman-tasks
 ruby-foreman-deface
 ruby-foreman-setup
 ruby-foreman-remote-execution
 foreman-postgresql
 foreman-dynflow-sidekiq
E: Sub-process /usr/bin/dpkg returned an error code (1)