RHEL-7 to RHEL-8 LEAPP upgrade failing when using Red Hat Satellite 6 server.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6
  • Red Hat Enterprise Linux 7.9
  • Red Hat Enterprise Linux 8.10

Issue

  • When trying to upgrade from RHEL 7.9 to RHEL 8.10, the client is failing to enable the RHEL 8 repositories with this output:

    Unable to install RHEL 8 userspace packages.
    'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.x', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'rhel-8-for-x86_64-baseos-rpms', '--enablerepo', u'rhel-8-for-x86_64-appstream-rpms', u'rhel-8-for-x86_64-baseos-rpms', '--enablerepo', u'rhel-8-for-x86_64-appstream-rpms', '--enablerepo', u'rhel-8-for-x86_64-appstream-rpms', '--enablerepo', u'rhel-8-for-x86_64-baseos-rpms', 'dnf'] failed with exit code 1.",
    Failed to synchronize cache for repo 'rhel-8-for-x86_64-appstream-rpms', ignoring this repo.\n
    Failed to synchronize cache for repo 'rhel-8-for-x86_64-supplementary-rpms', ignoring this repo.\n
    Failed to synchronize cache for repo 'rhel-8-for-x86_64-baseos-rpms', ignoring this repo.\n
    Failed to synchronize cache for repo 'codeready-builder-for-rhel-8-x86_64-rpms', ignoring this repo.\n
    Error: Unable to find a match: dnf\n"}
    
  • The upgrade fails with the following error:

    2020-01-01 00:00:00.12345 [ERROR] Actor: target_userspace_creator
    Message: Cannot find required basic RHEL 8 repositories.
    

Resolution

IMPORTANT NOTE
The supported leapp upgrade path for RHEL 7.9 is RHEL 8.10. Please check the document here.

  1. Ensure you have a subscription on the Satellite that provides access to the RHEL 8 product Red Hat Enterprise Linux for x86_64.

  2. Visit the "Red Hat Repositories" page on the Satellite WebUI and enable the required repositories per the LEAP documentation.

     - Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server 
       rhel-7-server-rpms
       x86_64 7Server
         or:
       Red Hat Enterprise Linux 7 Server RPMs x86_64 7.9
       rhel-7-server-rpms
         or:
       Red Hat Enterprise Linux 7 Server - Extended Life Cycle Support RPMs x86_64
       rhel-7-server-els-rpms
    
     - Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64 
       rhel-7-server-extras-rpms
    
     - Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 8.10
       rhel-8-for-x86_64-appstream-rpms
    
     - Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 8.10
       rhel-8-for-x86_64-baseos-rpms
    

The 8.10 repositories are crucial here; enabling and syncing their RHEL8 variants (i.e. "x86_64 8") will end up in the same error!

  1. Visit the Sync Status page on the Satellite WebUI and ensure the repositories listed above have been synced in the last 24 hours.

  2. a) If the client is using a content view, it is highly suggested to remove the client from it and assign the client to the Library lifecycle environment and Default Organization View content view to ensure the client has unrestricted access to all of the content during the upgrade.
    b) If you must utilize a content view on your client, please ensure that the content view:

        - Must have the repositories listed above
        - The latest version of the content view is showing in the lifecycle environment that matches that of the client
        - Does NOT contain a filter that would filter out packages needed by the upgrade process (If you require a filter, please make note of the use of the filter on the content view when you open your support case along with the parameters used to filter content)
        - Has been published within the last 24 hours and the publish date postdates your repository sync dates. **Do not publish a content view while the repositories are still syncing**
    
  3. Ensure the client system has all changes made available to them by having the client check in to the Satellite and recreate the entitlement certificate with the following command:
    # subscription-manager refresh

  4. Ensure the client has a subscription attached that will provide access to both RHEL 7 and RHEL 8 content:
    # subscription-manager list --consumed | grep -e 'Red Hat Enterprise Linux Server$' -e 'Red Hat Enterprise Linux for x86_64$'
    NOTE: Ensure repo override is enabled for the above mentioned repositories

  5. Ensure the client has the correct repositories enabled prior to starting the upgrade:
    # subscription-manager repos --enable rhel-7-server-rpms --enable rhel-7-server-extras-rpms
    NOTE: The RHEL 7 EUS repository rhel-7-server-eus-rpms is not the same as the non-EUS repository shown above. If you are using EUS repositories, please remove them from the content view or disable them on the client prior to this upgrade and use the documented repository
    NOTE: If the leapp upgrade failed for some reason and the in the next try if the repos are not available, go through this solution.

  6. Ensure the release version of the client is set to "7Server" according to the documentation:
    NOTE: A release status of: "Release not set" will default to 7Server
    # subscription-manager release --set 7Server
    or
    # subscription-manager release --unset
    NOTE: An error of:
    No releases match '7Server'. Consult 'release --list' for a full listing.
    This means that you did not include the 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server' specific repository in the content view. You can view the available release options using subscription-manager release --list. Please revisit the content view and ensure that the repository 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server' is included in your latest version published of your content view and the latest version is promoted to the lifecycle environment associated with the client.

  7. If you are using the yum versionlock plugin on the client, or if you are unsure if you are, run the following command to clear any version locks:
    # yum versionlock clear
    NOTE: If your return looks like:
    No such command: versionlock. Please use /usr/bin/yum --help
    Then you didn't have the yum versionlock plugin enabled and running this command changed nothing. It is safe to continue with this error.

  8. Ensure you have the system locale set to en_US.UTF-8:
    # cat /etc/locale.conf LANG="en_US.UTF-8"

  9. Update all packages to the latest RHEL 7 version:
    # yum update -y

  10. Verify that the latest versions of leapp and leapp-upgrade-el7toel8 are installed.

  11. Reboot the client:
    # reboot

  12. Retry your pre-upgrade or upgrade again:

    • Preupgrade:
      # leapp preupgrade --target 8.10
    • Upgrade:
      # leapp upgrade --target 8.10

For more KB articles/solutions related to Red Hat Satellite 6.x LEAPP Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x LEAPP Issues

Root Cause

  • The correct RHEL 8 repositories were not available to the client at the time of the pre-upgrade/upgrade.

Diagnostic Steps

  • Before upgrading, check if the client is using a Satellite for the upgrade:
    # grep hostname /etc/rhsm/rhsm.conf
    The above output should not say subscription.rhsm.redhat.com if the client is configured to be registered to a Satellite server

  • Check if the client is using a content view:
    # subscription-manager identity | grep "environment name"
    If anything other than "Library" is shown (exact match) then the client is using content view

  • The name of the content view is what is located after the "/" and the name of the lifecycle environment is what is located before the "/"*
Components
Category

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.