Leapp inplace upgrade fails from Rocky 8 to 9 - "This system is not yet registered"

Problem:
I want to upgrade the major Linux release of my Foreman host from Rocky Linux 8 to Rocky Linux 9. The leapp preupgrade check fails with the error
This system is not yet registered. Try 'subscription-manager register --help' for more information.:

============================================================
                           ERRORS                           
============================================================

2024-12-20 12:18:12.754179 [ERROR] Actor: scan_subscription_manager_info
Message: A subscription-manager command failed to execute
Summary:
    Details: Command ['subscription-manager', 'release'] failed with exit code 1.
    Stderr: This system is not yet registered. Try 'subscription-manager register --help' for more information.
    Hint: Please ensure you have a valid RHEL subscription and your network is up. If you are using proxy for Red Hat subscription-manager, please make sure it is specified inside the /etc/rhsm/rhsm.conf file. Or use the --no-rhsm option when running leapp, if you do not want to use subscription-manager for the in-place upgrade and you want to deliver all target repositories by yourself or using RHUI on public cloud.
    Link: https://access.redhat.com/solutions/6138372

and

# cat /var/log/leapp/leapp-report.txt
Risk Factor: high (error)
Title: A subscription-manager command failed to execute
Summary: {"details": "Command ['subscription-manager', 'release'] failed with exit code 1.", "stderr": "This system is not yet registered. Try 'subscription-manager register --help' for more information.\n", "hint": "Please ensure you have a valid RHEL subscription and your network is up. If you are using proxy for Red Hat subscription-manager, please make sure it is specified inside the /etc/rhsm/rhsm.conf file. Or use the --no-rhsm option when running leapp, if you do not want to use subscription-manager for the in-place upgrade and you want to deliver all target repositories by yourself or using RHUI on public cloud.", "link": "https://access.redhat.com/solutions/6138372"}
Key: 7ec8269784db1bba2ac54ae438689ef397e16833
[ ... ]

Of course, this system is not registered using subscription-manager, because only Red Hat RHEL systems must to be registered. Alternative EL distributions can’t be registered.

The following documentation was used:
https://docs.theforeman.org/3.12/Upgrading_Project/index-foreman-el.html#upgrading_EL_on_foreman_or_proxy_upgrading-connected

Expected outcome:
Leapp Upgrade with out errors.
It doesn’t make sense to check subscription-manager registrations for alternative EL distros.

Foreman and Proxy versions:
3.12.1

Foreman and Proxy plugin versions:

Name Version
foreman-tasks 9.2.3
foreman_ansible 14.2.1
foreman_remote_execution 13.2.5
katello 4.14.1

Distribution and version:
NAME=“Rocky Linux”
VERSION=“8.10 (Green Obsidian)”

Other relevant data:

[root@foreman.my.org ~]# dnf copr enable @theforeman/leapp
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Enabling a Copr repository. Please note that this repository is not part
of the main distribution, and quality may vary.

The Fedora Project does not exercise any power over the contents of
this repository beyond the rules outlined in the Copr FAQ at
<https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>,
and packages are not held to any quality or security level.

Please do not file bug reports about these packages in Fedora
Bugzilla. In case of problems, contact the owner of this repository.

Do you really want to enable copr.fedorainfracloud.org/@theforeman/leapp? [y/N]: y
Repository successfully enabled.


[root@foreman.my.org ~]# dnf install leapp leapp-upgrade-el8toel9
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Copr repo for leapp owned by @theforeman                                   37 kB/s |  19 kB     00:00    
Dependencies resolved.
==========================================================================================================
 Package               Arch   Version         Repository                                             Size
==========================================================================================================
Installing:
 leapp                 noarch 0.18.0-1.el8_10 appstream                                              34 k
 leapp-upgrade-el8toel9
                       noarch 0.21.0-2.1.el8  copr:copr.fedorainfracloud.org:group_theforeman:leapp 1.2 M
Installing dependencies:
 leapp-deps            noarch 0.18.0-1.el8_10 appstream                                              16 k
 leapp-upgrade-el8toel9-deps
                       noarch 0.21.0-2.1.el8  copr:copr.fedorainfracloud.org:group_theforeman:leapp  42 k
 python3-leapp         noarch 0.18.0-1.el8_10 appstream                                             188 k
 systemd-container     x86_64 239-82.el8_10.3 baseos                                                781 k

Transaction Summary
==========================================================================================================
Install  6 Packages

Total download size: 2.3 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): leapp-0.18.0-1.el8_10.noarch.rpm                                    91 kB/s |  34 kB     00:00    
(2/6): leapp-deps-0.18.0-1.el8_10.noarch.rpm                               42 kB/s |  16 kB     00:00    
(3/6): python3-leapp-0.18.0-1.el8_10.noarch.rpm                           496 kB/s | 188 kB     00:00    
(4/6): leapp-upgrade-el8toel9-deps-0.21.0-2.1.el8.noarch.rpm              1.7 MB/s |  42 kB     00:00    
(5/6): leapp-upgrade-el8toel9-0.21.0-2.1.el8.noarch.rpm                    24 MB/s | 1.2 MB     00:00    
(6/6): systemd-container-239-82.el8_10.3.x86_64.rpm                       996 kB/s | 781 kB     00:00    
----------------------------------------------------------------------------------------------------------
Total                                                                     1.2 MB/s | 2.3 MB     00:01     
Copr repo for leapp owned by @theforeman                                   56 kB/s | 1.0 kB     00:00    
Importing GPG key 0x665AC68C:
 Userid     : "@theforeman_leapp (None) <@theforeman#leapp@copr.fedorahosted.org>"
 Fingerprint: AF68 CE15 A0B5 D26F D7C7 2331 469C 7474 665A C68C
 From       : https://download.copr.fedorainfracloud.org/results/@theforeman/leapp/pubkey.gpg
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                  1/1 
  Installing       : systemd-container-239-82.el8_10.3.x86_64                                         1/6 
  Installing       : leapp-upgrade-el8toel9-deps-0.21.0-2.1.el8.noarch                                2/6 
  Installing       : leapp-deps-0.18.0-1.el8_10.noarch                                                3/6 
  Installing       : python3-leapp-0.18.0-1.el8_10.noarch                                             4/6 
  Installing       : leapp-0.18.0-1.el8_10.noarch                                                     5/6 
  Installing       : leapp-upgrade-el8toel9-0.21.0-2.1.el8.noarch                                     6/6 
  Running scriptlet: leapp-upgrade-el8toel9-0.21.0-2.1.el8.noarch                                     6/6 
  Verifying        : leapp-0.18.0-1.el8_10.noarch                                                     1/6 
  Verifying        : leapp-deps-0.18.0-1.el8_10.noarch                                                2/6 
  Verifying        : python3-leapp-0.18.0-1.el8_10.noarch                                             3/6 
  Verifying        : systemd-container-239-82.el8_10.3.x86_64                                         4/6 
  Verifying        : leapp-upgrade-el8toel9-0.21.0-2.1.el8.noarch                                     5/6 
  Verifying        : leapp-upgrade-el8toel9-deps-0.21.0-2.1.el8.noarch                                6/6 
Installed products updated.

Installed:
  leapp-0.18.0-1.el8_10.noarch                      leapp-deps-0.18.0-1.el8_10.noarch                     
  leapp-upgrade-el8toel9-0.21.0-2.1.el8.noarch      leapp-upgrade-el8toel9-deps-0.21.0-2.1.el8.noarch     
  python3-leapp-0.18.0-1.el8_10.noarch              systemd-container-239-82.el8_10.3.x86_64              

Complete!


[root@foreman.my.org ~]# dnf install leapp-data-rocky
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:00:19 ago on Fr 20 Dez 2024 12:46:52 CET.
Dependencies resolved.
==========================================================================================================
 Package            Arch     Version        Repository                                               Size
==========================================================================================================
Installing:
 leapp-data-rocky   noarch   0.4-1.el8      copr:copr.fedorainfracloud.org:group_theforeman:leapp    10 k

Transaction Summary
==========================================================================================================
Install  1 Package

Total download size: 10 k
Installed size: 2.4 k
Is this ok [y/N]: y
Downloading Packages:
leapp-data-rocky-0.4-1.el8.noarch.rpm                                     380 kB/s |  10 kB     00:00    
----------------------------------------------------------------------------------------------------------
Total                                                                     334 kB/s |  10 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                  1/1 
  Installing       : leapp-data-rocky-0.4-1.el8.noarch                                                1/1 
  Verifying        : leapp-data-rocky-0.4-1.el8.noarch                                                1/1 
Installed products updated.

Installed:
  leapp-data-rocky-0.4-1.el8.noarch                                                                       

Complete!


[root@foreman.my.org ~]# vi /etc/leapp/files/leapp_upgrade_repositories.repo
leapp preupgrade
[ ... ]
============================================================
                           ERRORS                           
============================================================

2024-12-20 12:50:45.010847 [ERROR] Actor: scan_subscription_manager_info
Message: A subscription-manager command failed to execute
Summary:
    Details: Command ['subscription-manager', 'release'] failed with exit code 1.
    Stderr: This system is not yet registered. Try 'subscription-manager register --help' for more information.
    Hint: Please ensure you have a valid RHEL subscription and your network is up. If you are using proxy for Red Hat subscription-manager, please make sure it is specified inside the /etc/rhsm/rhsm.conf file. Or use the --no-rhsm option when running leapp, if you do not want to use subscription-manager for the in-place upgrade and you want to deliver all target repositories by yourself or using RHUI on public cloud.
    Link: https://access.redhat.com/solutions/6138372

============================================================
                       END OF ERRORS                        
============================================================

Debug output written to /var/log/leapp/leapp-preupgrade.log

============================================================
                      REPORT OVERVIEW                       
============================================================

Following errors occurred and the upgrade cannot continue:
    1. Actor: scan_subscription_manager_info
       Message: A subscription-manager command failed to execute

Reports summary:
    Errors:                      1
    Inhibitors:                  0
    HIGH severity reports:       0
    MEDIUM severity reports:     0
    LOW severity reports:        0
    INFO severity reports:       1

Before continuing, review the full report below for details about discovered problems and possible remediation instructions:
    A report has been generated at /var/log/leapp/leapp-report.txt
    A report has been generated at /var/log/leapp/leapp-report.json

============================================================
                   END OF REPORT OVERVIEW                   
============================================================

Answerfile has been generated at /var/log/leapp/answerfile

Running leapp with option --no-rhsm should help.

2 Likes

Many thanks!
This is the correct solution for my question above.

leapp preupgrade --no-rhsm

However, I am experiencing further dependency problems, which I may address in a new question.