Bug 2101510
| Summary: | If Register() with enable_content == True is used, GetPools() does not return consumed entitlements for non-SCA accounts | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Martin Kolman <mkolman> | |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> | |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> | |
| Severity: | high | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 8.7 | CC: | jhnidek, jsefler, jstavel, jstodola, mkolman, redakkan | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | 8.8 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | subscription-manager-1.28.33-1.el8 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2118962 (view as bug list) | Environment: | ||
| Last Closed: | 2023-05-16 09:07:12 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: | ||||
| Bug Blocks: | 2083318, 2083319, 2118962 | |||
a playbook to simulate this case It works as supposed with the latest jenkins rpms build
PACKAGES TESTED:
python3-cloud-what-1.29.30+52.g044e0a551-1.git.0.5176e55.x86_64
python3-subscription-manager-rhsm-1.29.30+52.g044e0a551-1.git.0.5176e55.x86_64
rhsm-icons-4^11.g9a71113-1.el9_1.noarch
subscription-manager-1.29.30+52.g044e0a551-1.git.0.5176e55.x86_64
subscription-manager-cockpit-4^11.g9a71113-1.el9_1.noarch
subscription-manager-rhsm-certificates-20220623-1.el9.noarch
I have verified this bug against
RHEL8.8-
subscription management server: 4.2.10-1
subscription management rules: 5.43
subscription-manager: 1.28.33-1.el8
dbus-send
--system
--print-reply
--dest='com.redhat.RHSM1'
'/com/redhat/RHSM1/RegisterServer'
com.redhat.RHSM1.RegisterServer.Start
string:""
- name: try to register a system using dbus method
command:
cmd: >-
dbus-send --address={{ socket_path }} --print-reply --dest=com.redhat.RHSM1.Register
/com/redhat/RHSM1/Register
com.redhat.RHSM1.Register.Register
string:'{{ rhsm.account.org }}'
string:'{{ rhsm.account.username }}'
string:'{{ rhsm.account.password }}'
dict:string:string:'enable_content','1'
dict:string:string:'',''
string:''
- name: Result should be json
set_fact:
response_from_register: "{{ out.stdout | split('string \"') | last | regex_replace('[ \"]+$','') }}"
- name: "format of a response is json. It should contains of fields 'id' and 'uuid', 'owner'"
ansible.builtin.assert:
that:
- response_from_register.id is defined
- response_from_register.owner is defined
- response_from_register.uuid is defined
fail_msg: "required field not in the response"
success_msg: "id, uuid, owner field in the response presented"
- name: DBus method GetPools before a DBus method AutoAttach is called
command:
cmd: >-
dbus-send --system --print-reply --dest=com.redhat.RHSM1
/com/redhat/RHSM1/Entitlement
com.redhat.RHSM1.Entitlement.GetPools
dict:string:string:"pool_subsets","consumed"
dict:string:string:"",""
string:""
register: out
ignore_errors: yes
TASK [Output from GetPools] ***************************************************************************************************************************************************************************************
ok: [kvm-02-guest08.rhts.eng.brq.redhat.com] =>
response_from_getpools:
consumed:
- account: '6371032'
active: true
addons: ''
contract: ''
ends: '2024-07-26'
pool_id: 8a99f9ac7b5ee892017b81e016ee08f6
provides:
'249': Red Hat Enterprise Linux for SAP HANA for x86_64 Beta
'326': Red Hat Enterprise Linux Fast Datapath Beta for x86_64
'362': Red Hat Enterprise Linux for Power, little endian Beta
'363': Red Hat Enterprise Linux for ARM 64 Beta
'433': Red Hat Enterprise Linux for IBM z Systems Beta
'475': Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
'486': Red Hat Enterprise Linux for x86_64 Beta
'487': Red Hat Enterprise Linux High Availability Beta
'488': Red Hat Enterprise Linux Resilient Storage Beta
'495': Red Hat CodeReady Linux Builder for x86_64 Beta
'496': Red Hat CodeReady Linux Builder for Power, little endian Beta
'497': Red Hat CodeReady Linux Builder for ARM 64 Beta
'498': Red Hat CodeReady Linux Builder for IBM z Systems Beta
'499': Red Hat Enterprise Linux for Real Time Beta
'501': Red Hat Enterprise Linux for Real Time for NFV Beta
'529': Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)
'552': Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta
'553': Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
'554': Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta
'555': Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
'576': Red Hat Directory Server Beta
'577': Red Hat Certificate System Beta
provides_management: 'No'
quantity_used: 1
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-2023:2984 |
Description of problem: If the Register() method of the RHSM DBus API is used with the enable_content option set to True, then calling GetPools() afterwards will return an empty list of consumed entitlements. If Register() is called with the same account but without enable_content set to True and followed by calling AutoAttach(), then GetPools will return the correct list of consumed entitlements. Version-Release number of selected component (if applicable): subscription-manager-1.28.30-1.el8.x86_64 How reproducible: Always Steps to Reproduce: 0. get a non-SCA account with some entitlements 1. using the RHSM Dbus API callRegister() method with the enable_content option set to True. 2. call the GetPool() DBus method Actual results: (Register() with enable_content equal to True and no AutoAttach() being called): [anaconda root@dhcp54 ~]# dbus-send --system --print-reply --dest=com.redhat.RHSM1 /com/redhat/RHSM1/Entitlement com.redhat.RHSM1.Entitlement.GetPools dict:string:string:"pool_subsets","consumed" dict:string:string:"","" string:"" method return time=1656347154.032764 sender=:1.7 -> destination=:1.39 serial=35 reply_serial=2 string "{"consumed": []}" Expected results: (output after Resiter() with no enable_content & AutoAttach): [anaconda root@dhcp113 ~]# dbus-send --system --print-reply --dest=com.redhat.RHSM1 /com/redhat/RHSM1/Entitlement com.redhat.RHSM1.Entitlement.GetPools dict:string:string:"pool_subsets","consumed" dict:string:string:"","" string:"" method return time=1656347202.490992 sender=:1.7 -> destination=:1.43 serial=40 reply_serial=2 string "{"consumed": [{"subscription_name": "Red Hat Beta Access", "provides": {"362": "Red Hat Enterprise Linux for Power, little endian Beta", "495": "Red Hat CodeReady Linux Builder for x86_64 Beta", "363": "Red Hat Enterprise Linux for ARM 64 Beta", "496": "Red Hat CodeReady Linux Builder for Power, little endian Beta", "497": "Red Hat CodeReady Linux Builder for ARM 64 Beta", "552": "Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta", "475": "Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian", "486": "Red Hat Enterprise Linux for x86_64 Beta", "553": "Red Hat Enterprise Linux for SAP Applications for x86_64 Beta", "498": "Red Hat CodeReady Linux Builder for IBM z Systems Beta", "487": "Red Hat Enterprise Linux High Availability Beta", "554": "Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta", "576": "Red Hat Directory Server Beta", "433": "Red Hat Enterprise Linux for IBM z Systems Beta", "499": "Red Hat Enterprise Linux for Real Time Beta", "488": "Red Hat Enterprise Linux Resilient Storage Beta", "577": "Red Hat Certificate System Beta", "555": "Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta", "501": "Red Hat Enterprise Linux for Real Time for NFV Beta", "249": "Red Hat Enterprise Linux for SAP HANA for x86_64 Beta", "326": "Red Hat Enterprise Linux Fast Datapath Beta for x86_64", "529": "Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)"}, "sku": "RH00069", "contract": "", "account": "6324596", "serial": 8997303736638496772, "pool_id": "8a99f9ac7b5ee892017b81d84325084b", "provides_management": "No", "active": true, "quantity_used": 1, "service_type": "L1-L3", "roles": "", "service_level": "Self-Support", "usage": "", "addons": "", "status_details": ["Subscription is current"], "subscription_type": "Standard", "starts": "2021-04-14", "ends": "2023-03-02", "system_type": "Physical"}]}" Additional info: This seems to be an isolated issue that does not apply to all RHSM API endpoints. For example when "subscription-manager list" is called, both environments return the same correct data: (enable_content machine): [anaconda root@dhcp54 ~]# subscription-manager list +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Beta Product ID: 486 Version: 8.7 Beta Arch: x86_64 Status: Subscribed Status Details: Starts: 04/14/21 Ends: 03/02/23 (machine without enable_content being used): [anaconda root@dhcp113 ~]# subscription-manager list +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Beta Product ID: 486 Version: 8.7 Beta Arch: x86_64 Status: Subscribed Status Details: Starts: 04/14/21 Ends: 03/02/23