Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2216704

Summary: 4xx error is not reported for 'status'
Product: Red Hat Enterprise Linux 9 Reporter: mhorky
Component: subscription-managerAssignee: CSI Client Tools Bugs <csi-client-tools-bugs>
Status: CLOSED MIGRATED QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 9.3CC: sbakaj
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 14:19:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mhorky 2023-06-22 10:12:06 UTC
Description of problem:
subscription-manager does not report 4xx messages sent by the Candlepin server. Instead, it shows the cached value and does not report the error status it has received.

Version-Release number of selected component (if applicable):


How reproducible:
100 %

Steps to Reproduce:
1. Spin up local Candlepin server
2. Register a new system to it
3. Restart the Candlepin server and make sure to redeploy the test data, to make the local certificate installed at the system invalid
4. Run 'subscription-manager status'

Actual results:

> +-------------------------------------------+
>    System Status Details
> +-------------------------------------------+
> Overall Status: Current
> 
> System Purpose Status: Not Specified

Expected results:

The 4xx status message is taken into account. One possibility is to do not display anything and only show the error message, as we usually do with error messages received from the server.

Another option is to include a message similar to the SCA one: show the table, but include additional information about the server reported failure.

> +-------------------------------------------+
>    System Status Details
> +-------------------------------------------+
> Overall Status: Current
> The system has received an error from the server: "Invalid Credentials". Cached value has been displayed.
> 
> System Purpose Status: Not Specified


Additional info:

The following is a debug output from the original reporter.

    [root@dhcp131-49 ~]# subscription-manager status --ondate=2025-01-28
    401 {'x-candlepin-request-uuid': 'c89118bc-b1ee-42a6-8751-5601fda37bd6', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "c89118bc-b1ee-42a6-8751-5601fda37bd6"
    }
     
    401 {'x-candlepin-request-uuid': 'fcf70c49-c049-44b9-98a5-a538f17f868b', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "fcf70c49-c049-44b9-98a5-a538f17f868b"
    }
     
    401 {'x-candlepin-request-uuid': '1a133ad8-d969-43a0-8747-0e3d2db9c434', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "1a133ad8-d969-43a0-8747-0e3d2db9c434"
    }
     
    401 {'x-candlepin-request-uuid': 'ad0889e4-b7ae-4654-af57-4ee50c2567f5', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "ad0889e4-b7ae-4654-af57-4ee50c2567f5"
    }
     
    +-------------------------------------------+
       System Status Details
    +-------------------------------------------+
    401 {'x-candlepin-request-uuid': '27c4cbdf-465a-4421-b283-deac40652f18', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "27c4cbdf-465a-4421-b283-deac40652f18"
    }
     
    Overall Status: Current
     
    200 {'x-candlepin-request-uuid': 'f8ea0b7a-3830-4593-a4ff-108f78d5be5c', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "mode" : "NORMAL",
      "modeReason" : null,
      "modeChangeTime" : null,
      "result" : true,
      "version" : "4.3.6",
      "release" : "1",
      "standalone" : true,
      "timeUTC" : "2023-06-22T08:25:39+00:00",
      "rulesSource" : "default",
      "rulesVersion" : "5.44",
      "managerCapabilities" : [ "instance_multiplier", "derived_product", "vcpu", "cert_v3", "hypervisors_heartbeat", "remove_by_pool_id", "syspurpose", "storage_band", "cores", "multi_environment", "hypervisors_async", "org_level_content_access", "guest_limit", "ram", "batch_bind" ],
      "keycloakRealm" : null,
      "keycloakAuthUrl" : null,
      "keycloakResource" : null,
      "deviceAuthRealm" : null,
      "deviceAuthUrl" : null,
      "deviceAuthClientId" : null,
      "deviceAuthScope" : null
    }
     
    401 {'x-candlepin-request-uuid': 'bd3bc901-55aa-4f67-b4c7-ae3091eeb8be', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:38 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "bd3bc901-55aa-4f67-b4c7-ae3091eeb8be"
    }
     
    401 {'x-candlepin-request-uuid': '7321a87b-e525-44b0-adcf-65718ff02a41', 'WWW-Authenticate': 'Basic Realm=candlepin', 'X-Version': '4.3.6-1', 'vary': 'accept-encoding', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 22 Jun 2023 08:25:39 GMT', 'Keep-Alive': 'timeout=60', 'Connection': 'keep-alive'}
    {
      "displayMessage" : "Invalid Credentials",
      "requestUuid" : "7321a87b-e525-44b0-adcf-65718ff02a41"
    }
     
    System Purpose Status: Not Specified

Comment 2 RHEL Program Management 2023-09-22 14:18:32 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-22 14:19:35 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.