Leapp preupgrade failes "Unable to find a match: dnf dnf-command(config-manager)"

So I started looking into updating our main Foreman server from CentOS 7 to RoclyLinux 8 using the instrucitons outlined in Upgrading and Updating Foreman

Things went pretty smooth till step 7 - Let Leapp analyze your system:

When I run ‘leapp preupgrade’ - all runs fine until ==> Processing phase TargetTransactionFactsCollection
It produces this message:

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

2022-10-11 13:20:04.184510 [ERROR] Actor: target_userspace_creator
Message: Unable to install RHEL 8 userspace packages.
Summary:
    Details: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', '/var/lib/leapp/scratch/mounts/root_/system_overlay', '--setenv=LEAPP_UPGRADE_PATH_TARGET_RELEASE=8.6', '--setenv=LEAPP_NO_RHSM=0', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_UPGRADE_PATH_FLAVOUR=default', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/el7toel8/tools', '--setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade/common/files:/etc/leapp/repos.d/system_upgrade/el7toel8/files', '--setenv=LEAPP_IPU_IN_PROGRESS=7to8', '--setenv=LEAPP_UNSUPPORTED=0', '--setenv=LEAPP_EXECUTION_ID=7582be75-1f0e-4059-94ba-69a43c433a5b', '--setenv=LEAPP_HOSTNAME=<my hostname>', 'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.6', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'leapp-foreman-client', '--enablerepo', u'leapp-foreman', '--enablerepo', u'leapp-foreman-plugins', '--enablerepo', u'leapp-katello-candlepin', '--enablerepo', u'leapp-puppet6', '--enablerepo', u'leapp-pulpcore', '--enablerepo', u'leapp-katello', 'dnf', 'dnf-command(config-manager)', '--disableplugin', 'subscription-manager'] failed with exit code 1.
    Stderr: Host and machine ids are equal (<my machine id>): refusing to link journals
            Error: Unable to find a match: dnf dnf-command(config-manager)

I have no clue why it says “Host and machine ids are equal” - when I generate a new machine ID I just get the same message with the new ID - but afaik that should not be a showstopper.
But the “Unable to find a match …” is a real error - I did some research but no solution so far - any suggestions ? (the only thing I found was about updating dnf but it’s already on the latest version available for CenOS 7 …)

(plan B would be to spin up a new server with RockyLinux 8 and migrate to that server but that is probably a much bigger task)

At this point, I also believe that the machine-id issue is not a showstopper.

For a reason I don’t know, I ran into the “Unable to find a match …” error when I re-ran leapp. I solved it by installing ‘dnf-plugins-core’.

This is indeed a red herring. It’s a warning from DNF which can be safely ignored.

The Unable to find a match: dnf dnf-command(config-manager) one is however your actual issue.

Did you try checking whether dnf-plugins-core is installed?

dnf-plugins-core is installed (that was one of the things I fixed in the very beginning):

rpm -qa | grep dnf-plug
python2-dnf-plugins-core-4.0.2.2-3.el7_6.noarch
dnf-plugins-core-4.0.2.2-3.el7_6.noarch

and indeed:

]# dnf config-manager -h
usage: dnf config-manager [-c [config file]] [-q] [-v] [--version]
                          [--installroot [path]] [--nodocs] [--noplugins]
                          [--enableplugin [plugin]] [--disableplugin [plugin]]
                          [--releasever RELEASEVER] [--setopt SETOPTS]
....

… and also:

]# cat /etc/dnf/plugins/subscription-manager.conf
[main]
enabled=1

Can you please show the output of rpm -qa 'leapp*' and the full contents of /etc/leapp/files/leapp_upgrade_repositories.repo?

Sure:

# rpm -qa 'leapp*'
leapp-upgrade-el7toel8-0.16.0-6.el7.elevate.noarch
leapp-upgrade-el7toel8-deps-0.16.0-6.el7.elevate.noarch
leapp-0.14.0-1.el7.noarch
leapp-deps-0.14.0-1.el7.noarch
leapp-data-rocky-0.1-6.el7.noarch
cat /etc/leapp/files/leapp_upgrade_repositories.repo
[leapp-foreman]
name=Foreman 3.3
baseurl=https://yum.theforeman.org/releases/3.3/el8/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=1
module_hotfixes=1

[leapp-katello]
name=Katello 4.5
baseurl=https://yum.theforeman.org/katello/4.5/katello/el8/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=1
module_hotfixes=1

[leapp-katello-candlepin]
name=Candlepin: an open source entitlement management system.
baseurl=https://yum.theforeman.org/katello/4.5/candlepin/el8/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman
enabled=1
gpgcheck=1
module_hotfixes=1
proxy=http://135.245.192.7:8000

[leapp-pulpcore]
name=pulpcore: Fetch, Upload, Organize, and Distribute Software Packages.
baseurl=https://yum.theforeman.org/pulpcore/3.18/el8/$basearch/
gpgkey=https://yum.theforeman.org/pulpcore/3.18/GPG-RPM-KEY-pulpcore
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=1
module_hotfixes=1

[leapp-foreman-plugins]
name=Foreman plugins 3.3
baseurl=https://yum.theforeman.org/plugins/3.3/el8/$basearch
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman
module_hotfixes=1

[leapp-foreman-client]
name=Foreman client 3.3
baseurl=https://yum.theforeman.org/client/3.3/el8/$basearch
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=0

[leapp-puppet6]
name=Puppet 6 Repository el 8 - $basearch
baseurl=http://yum.puppetlabs.com/puppet6/el/8/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet6-release
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet6-release
enabled=1
proxy=http://135.245.192.7:8000
gpgcheck=1


Those are not the packages from Packages for @theforeman/leapp which we document to use. (They might work, but we haven’t tested them).

This file is missing all the Rocky repositories (as shipped in leapp-data-rocky) and thus Leapp can’t find the EL8 dnf build that you need.

Here is the original version of the file:

[rocky8-baseos]
name=Rocky Linux 8 - BaseOS
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[rocky8-appstream]
name=Rocky Linux 8 - AppStream
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[rocky8-powertools]
name=Rocky Linux 8 - PowerTools
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[rocky8-ha]
name=Rocky Linux 8 - HighAvailability
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=HighAvailability-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/HighAvailability/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[rocky8-resilient-storage]
name=Rocky Linux 8 - ResilientStorage
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=ResilientStorage-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/ResilientStorage/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[rocky8-extras]
name=Rocky Linux 8 - Extras
mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=extras-8
#baseurl=http://dl.rockylinux.org/pub/rocky/8/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

You need to add the Foreman repositories to that file, not replace them :slight_smile:

1 Like

Looks like that fixed things - it’s still running the preupgrade at this very moment but it would have bombed out already quite a while ago.
I really missed that - I got some errors about missing repos during the initial steps which I fixed by adding the RockyLinux repos in /etc/yum.repos.d so I thought that repo-wise, things were pretty much OK. Very misleading message too imho (and very little hits when searching for help).
Many thanks for pointing that out for me. Looks like I’m pretty close to giving the upgrade a shot (disks are in a RAID10 so I plan to unplug one half of the mirror and then run the upgrade - keeping a lifeline to revert …)

For the record: I initially had selinux disabled - that too resulted in an error which surprised me a little - I got around that by switching to Permissive.

Thanks again - cheers