Repositories getting disabled automatically while performing the leapp upgrade on a host that is registered to the Red Hat Satellite server
Environment
- Red Hat Satellite 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Issue
- Upon the failure of the
leapp preupgradecommand,yum repolistreturns the 'extras' repository in a disabled state automatically. - Below errors were observed when the
optionalrepository was enabled automatically, but theextrasrepository was disabled after each leapp preupgrade was run.
# cat /var/log/leapp/leapp-report.txt
Risk Factor: high (error)
Title: 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.10', '--setenv=LEAPP_NO_RHSM=0', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_TARGET_PRODUCT_CHANNEL=ga', '--setenv=LEAPP_UPGRADE_PATH_FLAVOUR=default', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/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=xxxxx', '--setenv=LEAPP_HOSTNAME=host.example.com', 'dnf', 'install', '-y', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.10', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'rhel-8-for-x86_64-baseos-rpms', '--enablerepo', u'codeready-builder-for-rhel-8-x86_64-rpms', '--enablerepo', u'rhel-8-for-x86_64-appstream-rpms', 'dnf', 'dnf-command(config-manager)'] failed with exit code 1.", "stderr": "Failed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system\nFailed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system\nHost and machine ids are equal (xxxxxxxxxxxxxx): refusing to link journals\nFailed to synchronize cache for repo 'rhel-8-for-x86_64-baseos-rpms', ignoring this repo.\nFailed to synchronize cache for repo 'codeready-builder-for-rhel-8-x86_64-rpms', ignoring this repo.\nModule yaml error: Unexpected key in component\nModule defaults error: Unexpected key in component\nError: Unable to find a match: dnf dnf-command(config-manager)\n"}
Key: xxxxxxxxxxxxxxxxxx
And/OR
# cat /var/log/leapp/leapp-report.txt
Risk Factor: high (error)
Title: A subscription-manager command failed to execute
Summary: {"details": "Command ['subscription-manager', 'repos', '--list-enabled'] failed with exit code 69.", "stderr": "Consumer profile \"xxxxxxxxxxxxxxxxxx\" has been deleted from the server. You can use command clean or unregister to remove local profile.\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."}
Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Resolution
If an activation key was used for the host registration to the Satellite
- Identify the activation key that's used to register the host in question.
Hosts --> Content hosts --> Details --> Registered By:Activation Key
- Ensure the required repositories are
enabled.
Content --> Activation keys --> Test_key --> Repository sets --> Status:Enabled
If it is in disabled state, make them enable by choosing override to enabled from the Actions drop down.
For example, below repositories should be enabled on the host while performing the leapp upgrade from RHEL 7.9 to RHEL 8.10
Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 8
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 8
Disable all other repositories including optional.
- Now, re-register the system and run the leapp again.
If there is no activation key
- Ensure that the client does not have any repository overrides disabling the target release's repositories.
# cat /var/lib/rhsm/cache/content_overrides.json | python3 -m json.tool
[
{
"created": "2024-07-08T16:48:37+0000",
"updated": "2024-07-08T16:48:37+0000",
"name": "enabled",
"contentLabel": "rhel-8-for-x86_64-appstream-rpms",
"value": "1"
},
{
"created": "2024-07-08T16:48:37+0000",
"updated": "2024-07-08T16:48:37+0000",
"name": "enabled_metadata",
"contentLabel": "rhel-8-for-x86_64-baseos-rpms",
"value": "1"
}
]
If you see "value": "0", go to the Web UI > Hosts > Content Hosts > hostname > Repository Sets > and set AppStream, and Baseos, to enabled.
- Execute
leapp preupgradeon the system again
Root Cause
- Required repositories are not enabled by default on the host.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.