Bug 2058662

Summary: Inaccurate module status/active flags send to Errata Notifications
Product: Red Hat Enterprise Linux 9 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 9.0CC: candlepin-bugs, cdonnell, jhnidek, jsefler, redakkan, rhsm-qe, thsimmon, zpetrace
Target Milestone: rcKeywords: Triaged
Target Release: 9.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.29-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2057732 Environment:
Last Closed: 2022-11-15 11:19:30 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:
Bug Depends On: 2057732    
Bug Blocks:    

Comment 1 Zdenek Petracek 2022-05-12 13:49:40 UTC
After conversation with dnf team and Martin Curlej, in RHEL9 there won't be any "default" modules thanks to policy change. However this bug was fixed for RHEL8 and it should be fixed for next releases. 
Pre-verification on RHEL8 machine:

after registering into SM I ran following commands:
export SUBMAN_DEBUG_PRINT_REQUEST=1
export SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1
export SUBMAN_DEBUG_PRINT_REQUEST_BODY=1
export SUBMAN_DEBUG_PRINT_RESPONSE=1

--> this will show the communication between sub-man and server

[root@muflon-3 ~]# subscription-manager version

Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/ {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'X-Correlation-ID': '3c6a13ce78b5486ba84bd925eb862029', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'Content-Length': '0'}

200 {'Server': 'openresty', 'Date': 'Mon, 09 May 2022 06:20:04 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=30', 'x-candlepin-request-uuid': 'd6cdd685-7ccc-4ad2-b80a-edf4e4c35ead', 'X-Version': '3.2.22-1'}
[{"rel":"rules","href":"/rules"},{"rel":"admin","href":"/admin"},{"rel":"deleted_consumers","href":"/deleted_consumers"},{"rel":"consumertypes","href":"/consumertypes"},{"rel":"users","href":"/users"},{"rel":"status","href":"/status"},{"rel":"hypervisors","href":"/hypervisors"},{"rel":"owners","href":"/owners"},{"rel":"distributor_versions","href":"/distributor_versions"},{"rel":"jobs","href":"/jobs"},{"rel":"","href":"/"},{"rel":"cdn","href":"/cdn"},{"rel":"activation_keys","href":"/activation_keys"},{"rel":"guestids","href":"/consumers/{consumer_uuid}/guestids"},{"rel":"products","href":"/products"},{"rel":"pools","href":"/pools"},{"rel":"content_overrides","href":"/consumers/{consumer_uuid}/content_overrides"},{"rel":"crl","href":"/crl"},{"rel":"subscriptions","href":"/subscriptions"},{"rel":"serials","href":"/serials"},{"rel":"content","href":"/content"},{"rel":"consumers","href":"/consumers"},{"rel":"roles","href":"/roles"},{"rel":"entitlements","href":"/entitlements"},{"rel":"packages", "href":"/consumers/{consumer_uuid}/packages"}]


Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/status {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'X-Correlation-ID': '3c6a13ce78b5486ba84bd925eb862029', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=subscription-manager) subscription-manager/1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'Content-Length': '0'}

200 {'Server': 'openresty', 'Date': 'Mon, 09 May 2022 06:20:04 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=30', 'x-candlepin-request-uuid': 'c43443c3-c669-48f3-a37e-763d8f3eaeae', 'x-version': '3.2.22-1'}
{"mode":"NORMAL","modeReason":null,"modeChangeTime":null,"result":true,"version":"3.2.22","rulesVersion":"5.41","release":"1","standalone":false,"timeUTC":"2022-05-09T06:20:03+0000","rulesSource":"default","keycloakRealm":"redhat-external","keycloakAuthUrl":"https://sso.stage.redhat.com/auth","keycloakResource":"cloud-services","managerCapabilities":["keycloak_auth","cloud_registration","instance_multiplier","derived_product","vcpu","cert_v3","hypervisors_heartbeat","remove_by_pool_id","syspurpose","storage_band","cores","hypervisors_async","org_level_content_access","guest_limit","ram","batch_bind","combined_reporting"]}

server type: Red Hat Subscription Management
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.28.29+26.gef68c681e-1.git.0.19a4cc4


[root@muflon-3 ~]# dnf uploadprofile --force-upload
Updating Subscription Management repositories.

Making request: subscription.rhsm.stage.redhat.com:443 GET /subscription/consumers/23d10134-3e71-439a-9b63-bb72bc5d6bc2/owner {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=dnf) subscription-manager/1.28.29+26.gef68c681e-1.git.0.19a4cc4', 'Content-Length': '0'}

200 {'Server': 'openresty', 'Date': 'Mon, 09 May 2022 06:22:46 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=30', 'x-candlepin-request-uuid': '593f402b-896c-475d-af39-70c55cb438a1', 'x-version': '3.2.22-1'}
{"created":"2021-09-08T13:27:21+0000","updated":"2022-03-23T14:31:41+0000","id":"8a99f9a67b367712017bc597706e75a8","key":"13281785","displayName":"13281785","parentOwner":null,"contentPrefix":null,"defaultServiceLevel":null,"upstreamConsumer":null,"logLevel":null,"autobindDisabled":false,"autobindHypervisorDisabled":false,"contentAccessMode":"entitlement","contentAccessModeList":"entitlement,org_environment","lastRefreshed":"2021-10-01T16:32:21+0000","href":"/owners/13281785"}
.
.
"installed_profiles": [], "status": "default", "active": false}, {"name": "rust-toolset", "stream": "rhel8", "version": "8060020220125235043", "context": "eab6f2ea", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": true}, {"name": "satellite-5-client", "stream": "1.0", "version": "8010020190621091459", "context": "cdc1202b", "arch": "x86_64", "profiles": ["common", "gui"], "installed_profiles": [], "status": "default", "active": true}, {"name": "scala", "stream": "2.10", "version": "820181213143541", "context": "2b79a98f", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": true}, {"name": "squid", "stream": "4", "version": "8060020220209171548", "context": "d63f516d", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": true}, {"name": "subversion", "stream": "1.10", "version": "8030020210210135829", "context": "4035eae3", "arch": "x86_64", "profiles": ["common", "server"], "installed_profiles": [], "status": "default", "active": true}, {"name": "subversion", "stream": "1.14", "version": "8040020210210122209", "context": "4d97b3c8", "arch": "x86_64", "profiles": ["common", "server"], "installed_profiles": [], "status": "default", "active": false}, {"name": "swig", "stream": "3.0", "version": "8030020200407110056", "context": "30b713e6", "arch": "x86_64", "profiles": ["common", "complete"], "installed_profiles": [], "status": "default", "active": true}, {"name": "swig", "stream": "4.0", "version": "8040020201001104431", "context": "9f9e2e7e", "arch": "x86_64", "profiles": ["common", "complete"], "installed_profiles": [], "status": "default", "active": false}, {"name": "varnish", "stream": "6", "version": "8050020220201171716", "context": "c5368500", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": true}, {"name": "virt", "stream": "rhel", "version": "8070020220427114939", "context": "3b9f49c4", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "enabled", "active": true}, {"name": "javapackages-tools", "stream": "201801", "version": "820181217165704", "context": "dca7b4a4", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": false}, {"name": "mariadb-devel", "stream": "10.3", "version": "8030020210324132345", "context": "229f0a1c", "arch": "x86_64", "profiles": [], "installed_profiles": [], "status": "default", "active": false}, {"name": "python38-devel", "stream": "3.8", "version": "8060020220120164031", "context": "5294be16", "arch": "x86_64", "profiles": [], "installed_profiles": [], "status": "default", "active": false}, {"name": "python39-devel", "stream": "3.9", "version": "8060020220118220913", "context": "d3811607", "arch": "x86_64", "profiles": [], "installed_profiles": [], "status": "default", "active": false}, {"name": "virt-devel", "stream": "rhel", "version": "8070020220427114939", "context": "3b9f49c4", "arch": "x86_64", "profiles": [], "installed_profiles": [], "status": "default", "active": false}]}]

--> status is shown as "default" as expected -> PASSED

If there would be any default streams on RHEL9, it is expected to behave in the same way.

Comment 5 Zdenek Petracek 2022-07-25 10:52:49 UTC
Final verification:

Version:
[root@kvm-02-guest09 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 4.0.18-2
subscription management rules: 5.41
subscription-manager: 1.29.29-1.el9

Registering:
[root@kvm-02-guest09 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: 
Username: zpetracePH03
Password: 
The system has been registered with ID: 20cad5aa-0aea-48a0-96a1-0da69d71f77f
The registered system name is: kvm-02-guest09.rhts.eng.brq.redhat.com


after registering into SM I ran following commands:
export SUBMAN_DEBUG_PRINT_REQUEST=1
export SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1
export SUBMAN_DEBUG_PRINT_REQUEST_BODY=1
export SUBMAN_DEBUG_PRINT_RESPONSE=1

getting info about the streams:
dnf uploadprofile --force-upload | grep default
.
.
.
{"name": "pipewire-pulseaudio", "version": "0.3.47", "release": "2.el9", "arch": "x86_64", "epoch": 0, "vendor": "Red Hat, Inc."}, {"name": "postfix", "version": "3.5.9", "release": "18.el9", "arch": "x86_64", "epoch": 2, "vendor": "Red Hat, Inc."}, {"name": "nano", "version": "5.6.1", "release": "5.el9", "arch": "x86_64", "epoch": 0, "vendor": "Red Hat, Inc."}]}, {"content_type": "enabled_repos", "profile": []}, {"content_type": "modulemd", "profile": [{"name": "ruby", "stream": "3.1", "version": "9010020220623124214", "context": "9", "arch": "x86_64", "profiles": ["common"], "installed_profiles": [], "status": "default", "active": false}]}]
^^ "installed_profiles" has status set to "default" = PASSED

Comment 7 errata-xmlrpc 2022-11-15 11:19:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (subscription-manager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8341