Bug 1652298 - wrong System Purpose Status is reported despite a match in SLA
Summary: wrong System Purpose Status is reported despite a match in SLA
Keywords:
Status: CLOSED DUPLICATE of bug 1660878
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: candlepin-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-21 20:09 UTC by John Sefler
Modified: 2019-01-10 15:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-10 15:24:07 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1660878 None CLOSED syspurpose status states should be one of matched/mismatched/not specified 2019-06-03 18:12:54 UTC

Internal Links: 1652870

Description John Sefler 2018-11-21 20:09:09 UTC
Description of problem:

After registering (with service-level and auto-attach) using a valid SLA of "Self-Support", the subscription-manager status reports an "invalid" system purpose status despite the facts that the auto-attached pool (HTB Self-Support SKU RH00076) correctly provide the requested SLA.  See reproducer using a rhel8 HTB system registering against stage candlepin 2.3.10-1 which supports "syspurpose" capabilities.



Version-Release number of selected component (if applicable):
[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.10-1
subscription management rules: 5.29
subscription-manager: 1.23.8-1.el8
[root@hp-dl380pgen8-02-vm-2 ~]# curl -k --stderr /dev/null https://subscription.rhsm.stage.redhat.com:443/subscription/status | python3 -m json.tool
{
    "mode": "NORMAL",
    "modeReason": "STARTUP",
    "modeChangeTime": "2018-11-19T13:58:34+0000",
    "result": true,
    "version": "2.3.10",   <============ VERSION
    "rulesVersion": "5.29",
    "release": "1",
    "standalone": false,
    "timeUTC": "2018-11-21T19:45:03+0000",
    "rulesSource": "DEFAULT",
    "managerCapabilities": [
        "instance_multiplier",
        "derived_product",
        "vcpu",
        "cert_v3",
        "remove_by_pool_id",
        "syspurpose",    <============== SYSPURPOSE CAPABILITY
        "storage_band",
        "cores",
        "hypervisors_async",
        "org_level_content_access",
        "guest_limit",
        "ram",
        "batch_bind"
    ]
}


How reproducible:


Steps to Reproduce:
[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com
[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# syspurpose show
{}
[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager service-level --list --username=stage_auto_testuser --org=11424630 --password=REDACTED
+-------------------------------------------+
               Available Service Levels
+-------------------------------------------+
Premium
Self-Support
Standard
[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager register --servicelevel=Self-Support --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_auto_testuser
Password: 
The system has been registered with ID: eb96064a-087b-4754-8a9c-41499bcc785b
The registered system name is: hp-dl380pgen8-02-vm-2.lab.bos.redhat.com
Service level set to: Self-Support
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux High Touch Beta
Provides:            Red Hat Enterprise Linux for x86_64 High Touch Beta
                     Red Hat Enterprise Linux 7 Workstation High Touch Beta
                     Red Hat Container Images HTB
                     Red Hat Enterprise Linux for IBM z Systems High Touch Beta
                     Red Hat Enterprise Linux for Power, little endian High Touch Beta
                     Red Hat CodeReady Linux Builder for x86_64 High Touch Beta
                     Red Hat Enterprise Linux 7 for HPC Compute Node High Touch Beta
                     Red Hat CodeReady Linux Builder for Power, little endian High Touch Beta
                     Red Hat Enterprise Linux for ARM 64 High Touch Beta
                     Red Hat Enterprise Linux for Real Time High Touch Beta
                     Red Hat Enterprise Linux Atomic Host HTB
                     Red Hat CodeReady Linux Builder for ARM 64 High Touch Beta
                     Red Hat Enterprise Linux High Availability High Touch Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems High Touch Beta
                     Red Hat Enterprise Linux 7 Load Balancer High Touch Beta
                     Red Hat Enterprise Linux Resilient Storage High Touch Beta
                     Red Hat Enterprise Linux for Real Time for NFV High Touch Beta
                     Red Hat Enterprise Linux 7 Desktop High Touch Beta
SKU:                 RH00076
Contract:            11526930
Account:             6128413
Serial:              1614355470276573379
Pool ID:             8a99f98160ffba370160fff18dc0124e
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Self-Support
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              01/16/2018
Ends:                01/15/2019
System Type:         Physical

[root@hp-dl380pgen8-02-vm-2 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: invalid

[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# syspurpose show
{
  "service_level_agreement": "Self-Support"
}
[root@hp-dl380pgen8-02-vm-2 ~]# 





Actual results:
System Purpose Status: invalid


Expected results:
System Purpose Status: Matches


Additional info:
There is nothing odd logged to rhsm.log...
2018-11-21 15:03:42,755 [DEBUG] subscription-manager:6798:MainThread @connection.py:591 - Making request: GET /subscription/consumers/eb96064a-087b-4754-8a9c-41499bcc785b/compliance
2018-11-21 15:03:43,160 [INFO] subscription-manager:6798:MainThread @connection.py:634 - Response: status=200, requestUuid=ac3a30c1-d626-4225-b1ef-6879e53f8592, request="GET /subscription/consumers/eb96064a-087b-4754-8a9c-41499bcc785b/compliance"
2018-11-21 15:03:43,162 [DEBUG] subscription-manager:6798:MainThread @cache.py:302 - Started thread to write cache: /var/lib/rhsm/cache/entitlement_status.json


There is also nothing about syspurpose compliance written to entitlement_status.json...

[root@hp-dl380pgen8-02-vm-2 ~]# cat /var/lib/rhsm/cache/entitlement_status.json | python3 -m json.tool
{
    "date": "2018-11-21T20:03:43+0000",
    "compliantUntil": "2019-01-16T00:00:00+0000",
    "nonCompliantProducts": [],
    "compliantProducts": {
        "230": [
            {
                "id": "94d3fc046c9948e68931c69b3bee35c1",
                "consumer": null,
                "pool": {
                    "id": "8a99f98160ffba370160fff18dc0124e",
                    "type": "NORMAL",
                    "owner": null,
                    "activeSubscription": true,
                    "createdByShare": false,
                    "hasSharedAncestor": false,
                    "sourceEntitlement": null,
                    "quantity": -1,
                    "startDate": "2018-01-16T05:00:00+0000",
                    "endDate": "2019-01-15T23:59:59+0000",
                    "attributes": [],
                    "restrictedToUsername": null,
                    "contractNumber": null,
                    "accountNumber": null,
                    "orderNumber": null,
                    "consumed": 2,
                    "exported": 0,
                    "shared": 0,
                    "branding": [],
                    "calculatedAttributes": null,
                    "upstreamPoolId": null,
                    "upstreamEntitlementId": null,
                    "upstreamConsumerId": null,
                    "productName": null,
                    "ownerId": null,
                    "productId": "RH00076",
                    "derivedProductId": null,
                    "productAttributes": [
                        {
                            "name": "product_family",
                            "value": "Red Hat Enterprise Linux"
                        },
                        {
                            "name": "enabled_consumer_types",
                            "value": "SAM"
                        },
                        {
                            "name": "unlimited_product",
                            "value": "yes"
                        },
                        {
                            "name": "ph_product_line",
                            "value": "RHEL"
                        },
                        {
                            "name": "description",
                            "value": "Red Hat Enterprise Linux"
                        },
                        {
                            "name": "ph_category",
                            "value": "Subscriptions"
                        },
                        {
                            "name": "support_level",
                            "value": "Self-Support"
                        },
                        {
                            "name": "type",
                            "value": "MKT"
                        },
                        {
                            "name": "cloud_access_enabled",
                            "value": "true"
                        },
                        {
                            "name": "ph_product_name",
                            "value": "RHEL Server"
                        },
                        {
                            "name": "expires_after",
                            "value": "365"
                        },
                        {
                            "name": "subtype",
                            "value": "Self-Support"
                        },
                        {
                            "name": "name",
                            "value": "Red Hat Enterprise Linux High Touch Beta"
                        },
                        {
                            "name": "variant",
                            "value": "Physical Server"
                        },
                        {
                            "name": "arch",
                            "value": "aarch64,ppc64le,s390x,x86_64"
                        },
                        {
                            "name": "support_type",
                            "value": "L1-L3"
                        }
                    ],
                    "stacked": false,
                    "stackId": null,
                    "developmentPool": false,
                    "derivedProductAttributes": [],
                    "derivedProductName": null,
                    "providedProducts": [
                        {
                            "productId": "232",
                            "productName": "Red Hat Enterprise Linux for IBM z Systems High Touch Beta"
                        },
                        {
                            "productId": "237",
                            "productName": "Red Hat Enterprise Linux 7 Load Balancer High Touch Beta"
                        },
                        {
                            "productId": "231",
                            "productName": "Red Hat Enterprise Linux 7 Workstation High Touch Beta"
                        },
                        {
                            "productId": "542",
                            "productName": "Red Hat CodeReady Linux Builder for x86_64 High Touch Beta"
                        },
                        {
                            "productId": "275",
                            "productName": "Red Hat Container Images HTB"
                        },
                        {
                            "productId": "502",
                            "productName": "Red Hat Enterprise Linux for Real Time for NFV High Touch Beta"
                        },
                        {
                            "productId": "545",
                            "productName": "Red Hat CodeReady Linux Builder for IBM z Systems High Touch Beta"
                        },
                        {
                            "productId": "238",
                            "productName": "Red Hat Enterprise Linux Resilient Storage High Touch Beta"
                        },
                        {
                            "productId": "230",
                            "productName": "Red Hat Enterprise Linux for x86_64 High Touch Beta"
                        },
                        {
                            "productId": "229",
                            "productName": "Red Hat Enterprise Linux 7 Desktop High Touch Beta"
                        },
                        {
                            "productId": "500",
                            "productName": "Red Hat Enterprise Linux for Real Time High Touch Beta"
                        },
                        {
                            "productId": "489",
                            "productName": "Red Hat Enterprise Linux for ARM 64 High Touch Beta"
                        },
                        {
                            "productId": "233",
                            "productName": "Red Hat Enterprise Linux for Power, little endian High Touch Beta"
                        },
                        {
                            "productId": "236",
                            "productName": "Red Hat Enterprise Linux High Availability High Touch Beta"
                        },
                        {
                            "productId": "247",
                            "productName": "Red Hat Enterprise Linux Atomic Host HTB"
                        },
                        {
                            "productId": "234",
                            "productName": "Red Hat Enterprise Linux 7 for HPC Compute Node High Touch Beta"
                        },
                        {
                            "productId": "544",
                            "productName": "Red Hat CodeReady Linux Builder for ARM 64 High Touch Beta"
                        },
                        {
                            "productId": "543",
                            "productName": "Red Hat CodeReady Linux Builder for Power, little endian High Touch Beta"
                        }
                    ],
                    "derivedProvidedProducts": [],
                    "sourceStackId": null,
                    "subscriptionSubKey": null,
                    "subscriptionId": null
                },
                "certificates": [],
                "quantity": 1,
                "startDate": "2018-01-16T05:00:00+0000",
                "endDate": "2019-01-15T23:59:59+0000",
                "href": "/entitlements/94d3fc046c9948e68931c69b3bee35c1"
            }
        ]
    },
    "partiallyCompliantProducts": {},
    "partialStacks": {},
    "productComplianceDateRanges": null,
    "reasons": [],
    "compliant": true,
    "status": "valid"
}

2018-11-21 15:03:43,164 [DEBUG] subscription-manager:6798:WriteCacheEntitlementStatusCacheThread @cache.py:114 - Wrote cache: /var/lib/rhsm/cache/entitlement_status.json

Comment 1 Kevin Howell 2018-12-06 15:12:20 UTC
Is this still an issue with 2.3.11 ?

Comment 2 John Sefler 2018-12-10 20:18:02 UTC
Yes - still an issue against 2.3.11-1....

[root@dell-r730-002-guest30 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.11-1
subscription management rules: 5.30
subscription-manager: 1.23.8-4.el8
[root@dell-r730-002-guest30 ~]# 
[root@dell-r730-002-guest30 ~]# syspurpose show
{
  "service_level_agreement": "Self-Support"
}
[root@dell-r730-002-guest30 ~]# 
[root@dell-r730-002-guest30 ~]# subscription-manager list --consumed | grep "Service Level"
Service Level:       Self-Support
[root@dell-r730-002-guest30 ~]# 
[root@dell-r730-002-guest30 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Invalid
                       ^^^^^^^
                       ^^^^^^^
            EXPECTED: "Matches" because all of the attached subscriptions (only 1 attached) provides all of the requested system purpose attributes (only 1 requested "service_level_agreement": "Self-Support").

Comment 3 Nikos Moumoulidis 2018-12-12 16:16:18 UTC
(In reply to John Sefler from comment #2)
> Yes - still an issue against 2.3.11-1....

> System Purpose Status: Invalid
>                        ^^^^^^^
>                        ^^^^^^^
>             EXPECTED: "Matches" because all of the attached subscriptions
> (only 1 attached) provides all of the requested system purpose attributes
> (only 1 requested "service_level_agreement": "Self-Support").

I can reproduce this issue, but I'm pretty sure this is a subman issue, not candlepin.
The syspurpose status is cached in a different cache file (/var/lib/rhsm/cache/syspurpose_compliance_status.json) than entitlement status, and the reason for non-compliance looks to me the addons (the fact that subman sends an empty string as a syspurpose addon value during registration, even though no addon is actually set in the client):

[vagrant@rhel8 vagrant]$ sudo cat /var/lib/rhsm/cache/syspurpose_compliance_status.json | python3 -m json.tool | tail
            }
        ]
    },
    "compliantUsage": {},
    "nonPreferredSLA": {},
    "nonPreferredUsage": {},
    "reasons": [
        "unsatisfied add on: "
    ]
}

Comment 4 Kevin Howell 2019-01-07 15:12:12 UTC
Can we please retest with latest subman and Candlepin in stage currently?

Comment 5 Rehana 2019-01-07 15:18:28 UTC
(In reply to Kevin Howell from comment #4)
> Can we please retest with latest subman and Candlepin in stage currently?

[root@kvm-01-guest29 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.12-1
subscription management rules: 5.30
subscription-manager: 1.23.8-12.el8

[root@kvm-01-guest29 ~]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux High Touch Beta
Provides:            Red Hat Enterprise Linux for x86_64 High Touch Beta
                     Red Hat Enterprise Linux 7 Workstation High Touch Beta
                     Red Hat Container Images HTB
                     Red Hat Enterprise Linux for IBM z Systems High Touch Beta
                     Red Hat Enterprise Linux for Power, little endian High Touch Beta
                     Red Hat CodeReady Linux Builder for x86_64 High Touch Beta
                     Red Hat Enterprise Linux 7 for HPC Compute Node High Touch Beta
                     Red Hat CodeReady Linux Builder for Power, little endian High Touch Beta
                     Red Hat Enterprise Linux for ARM 64 High Touch Beta
                     Red Hat Enterprise Linux for Real Time High Touch Beta
                     Red Hat Enterprise Linux Atomic Host HTB
                     Red Hat CodeReady Linux Builder for ARM 64 High Touch Beta
                     Red Hat Enterprise Linux High Availability High Touch Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems High Touch Beta
                     Red Hat Enterprise Linux 7 Load Balancer High Touch Beta
                     Red Hat Enterprise Linux Resilient Storage High Touch Beta
                     Red Hat Enterprise Linux for Real Time for NFV High Touch Beta
                     Red Hat Enterprise Linux 7 Desktop High Touch Beta
SKU:                 RH00076
Contract:            11668021
Account:             6151598
Serial:              2158578201453911717
Pool ID:             8a99f9ad66baea7d0166f318bd2308f3
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Self-Support
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              Thursday 08 November 2018
Ends:                Thursday 07 November 2019
System Type:         Physical

[root@kvm-01-guest29 ~]# syspurpose show
{
  "service_level_agreement": "Self-Support"
}
System purpose successfully sent to subscription management server.

[root@kvm-01-guest29 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Current


With a match in sla it now says "current" which is still wrong , but not displaying as invalid any more.

Comment 6 Chris Snyder 2019-01-10 15:24:07 UTC

*** This bug has been marked as a duplicate of bug 1660878 ***


Note You need to log in before you can comment on or make changes to this bug.