Failing RHEL8 to 9 upgrade due to ruby 2.7

Hello,
I’m unable to update my foreman (3.12.1) running over a RHEL8.
I followed the documentation here : Upgrading Foreman to 3.12

after the execution of the ‘leapp preupgrade’ command I have 10 dependancy problems (all related to ruby/rubygem/ruby-libs/ruby-something).

problem 1 is the following, I suppose this is the main issue:

             Problem 1: problem with installed package ruby-2.7.8-139.module+el8.8.0+18745+f1bef313.x86_64
              - cannot install the best update candidate for package ruby-2.7.8-139.module+el8.8.0+18745+f1bef313.x86_64
              - ruby-3.0.3-159.el9.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - package rubygem-katello-4.14.3-1.el9.noarch from leapp-katello requires ruby < 3.1, but none of the providers can be installed
              - ruby-3.0.4-161.el9.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - ruby-3.0.7-162.el9_4.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - ruby-3.0.4-160.el9_0.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - ruby-3.0.7-163.el9_5.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - ruby-3.0.7-165.el9_5.i686 from rhel-9-for-x86_64-appstream-rpms  does not belong to a distupgrade repository
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.3-159.el9.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.4-161.el9.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.7-162.el9_4.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.4-160.el9_0.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.7-163.el9_5.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install both ruby-3.3.8-4.module+el9.5.0+23030+26c9b8e1.x86_64 from rhel-9-for-x86_64-appstream-rpms and ruby-3.0.7-165.el9_5.x86_64 from rhel-9-for-x86_64-appstream-rpms
              - cannot install the best candidate for the job
              - ruby-2.7.8-139.module+el8.8.0+18745+f1bef313.x86_64 from @System  does not belong to a distupgrade repository

another useful information, this server is ‘offline’, not directly connected to the Internet.
RHEL repos (AppStream and baseOS, maybe another one is needed for the update?) comes from a satellite server where RHEL 9.5 is available.
Foreman and others related repos comes from an artifactory infrastructure:

# dnf repolist
Updating Subscription Management repositories.
repo id                                                                              repo name
candlepin                                                                            Candlepin: an open source entitlement management system.
foreman                                                                              Foreman 3.12
foreman-plugins                                                                      Foreman plugins 3.12
katello                                                                              Katello 4.14
pulpcore                                                                             pulpcore: Fetch, Upload, Organize, and Distribute Software Packages.
puppet7                                                                              Puppet 7 Repository el 8 - x86_64
rhel-8-for-x86_64-appstream-rpms                                                     Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms                                                        Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

I had to install the leapp packages manually from the copr repo:

# dnf list installed | grep leapp
leapp.noarch                                               0.18.0-1.el8                                 @@commandline
leapp-deps.noarch                                          0.18.0-1.el8                                 @@commandline
leapp-upgrade-el8toel9.noarch                              0.21.0-2.1.el8                               @@commandline
leapp-upgrade-el8toel9-deps.noarch                         0.21.0-2.1.el8                               @@commandline
python3-leapp.noarch                                       0.18.0-1.el8                                 @@commandline

What did I do wrong? Any idea how to solve the issue?
Thanks for your help
Regards
Z.

disable all repos in yum.repos.d apart from the _copr repo that got created when Leapp was installed.
During the upgrade, Leapp seems to kick a fuss with conflicts if any other repos outside of copr and it’s files directory are enabled

Thanks, Mmmmhhh, I have no repo in yum.repos.d from the newly installed packages.
maybe I made it wrong, I’m almost offline (behind a satellite and an artifactory), for the copr part I manually installed the packages below from the copr repo (I cannot run the “dnf copr enable @theforeman/leapp” command) :

leapp.noarch                                               0.18.0-1.el8                                 @@commandline
leapp-deps.noarch                                          0.18.0-1.el8                                 @@commandline
leapp-upgrade-el8toel9.noarch                              0.21.0-2.1.el8                               @@commandline
leapp-upgrade-el8toel9-deps.noarch                         0.21.0-2.1.el8                               @@commandline
python3-leapp.noarch                                       0.18.0-1.el8                                 @@commandline

is the command copr doing something else than installing those pkgs ?
thanks

I just tried to disable anything from /etc/yum.repos.d (just keeping repos configured in the leapp repo in /etc/leapp/files/leapp_upgrade_repositories.repo) but I have the exact same issue :frowning:

every time I execute the leapp preupgrade command the redhat yum repos for RHEL8 (basesos and appstream) are reenabled.

Just a thought you could take a different approach and do a satellite cloning approach. Build a new rhel 9 server identical to rhel cpu, memory , disk space etc. This allows you to keep the old foreman server if the cloning dosent go as planned. And decommission the old one once complete. That’s what I did earlier this week. See link below

Not sure if this is an option for foreman.

Looks like Foreman does a Migration by using backup and restore.
https://docs.theforeman.org/3.12/Upgrading_Project/index-katello.html#upgrading_EL_on_foreman_or_proxy_upgrading-connected

See 3.2 ### Migrating Foreman or Smart Proxy to EL 9 using backup and restore.