Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-1228

Detect that no RHSM credentials were given or the account does not have SCA enabled

XMLWordPrintable

    • False
    • False
    • Hide

      None

      Show
      None
    • 3
    • 2023-R4, 2024-R2
    • Testable

      Currently, our subscription-manager action is not detecting correctly that the system does not have an subscription/pool id attached while it is registered with a non-SCA account - it is only issuing a warning to inform that it was not able to reload the configuration for subscription-manager but it should be erroring out because without an attached subscription the system can't access RHEL repos.

      The problem is that when convert2rhel detects that the system is already registered and no credentials to re-register are passed, it expects the SCA to be enabled as it does not allow attaching a subscription without also registering the system right now.

      A warning that should be an error:

      [2023-11-01T17:50:10+0000] TASK - [Convert: Subscription Manager - Reload configuration] *************
      [2023-11-01T17:50:10+0000] DEBUG - Calling command 'subscription-manager refresh'
      subscription-manager has reloaded its configuration.
      WARNING - No rhsm credentials given to subscribe the system. Skipping the subscription step.
      

      Job that detect the rhsm credentials:

      [2023-11-01T17:50:17+0000] TASK - [Convert: Get RHEL repository IDs] *********************************
      RHEL repository IDs to enable: rhel-7-server-rpms
      
      [2023-11-01T17:50:17+0000] TASK - [Convert: Subscription Manager - Disable all repositories] *********
      [2023-11-01T17:50:17+0000] DEBUG - Calling command 'subscription-manager repos --disable=*'
      CRITICAL - Repositories were not possible to disable through subscription-manager:
      This system has no repositories available through subscriptions.
      
      ERROR - (ERROR) SUBSCRIBE_SYSTEM::UNKNOWN_ERROR - Unknown error
       Description: The cause of this error is unknown, please look at the diagnosis for more information.
       Diagnosis: Repositories were not possible to disable through subscription-manager:
      This system has no repositories available through subscriptions.
      
       Remediation: [No further information given]
      

      Acceptance Criteria

      • When the system is registered prior to the conversion with an SCA-disabled account AND no subscription/pool ID is attached AND no RHSM credentials are passed to convert2rhel:
        1. A warning is printed saying that without an attached subscription or SCA being enabled the system can't access RHEL repositories, and that we'll try to auto-attach a subscription.
        2. We try to auto attach a subscription by running 'subscription-manager attach --auto'. If unsuccessful, we emit and error saying that the auto attachment wasn't succesful and that to resolve that, the customer can either attach a subscription manually by running 'subscription-manager attach --pool <pool id>' prior to running convert2rhel or enable Simple Content Access on their RHSM account (and linking to https://access.redhat.com/articles/simple-content-access).

          There are no Sub-Tasks for this issue.

              prwatson@redhat.com Preston Watson
              rolivier@redhat.com Rodolfo Olivieri
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: