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 2101510 - If Register() with enable_content == True is used, GetPools() does not return consumed entitlements for non-SCA accounts
Summary: If Register() with enable_content == True is used, GetPools() does not return...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.7
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: 8.8
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 2083318 2083319 2118962
TreeView+ depends on / blocked
 
Reported: 2022-06-27 16:31 UTC by Martin Kolman
Modified: 2023-05-16 11:10 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.28.33-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2118962 (view as bug list)
Environment:
Last Closed: 2023-05-16 09:07:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 3080 0 None Merged 2101510: Fix D-Bus Register() and update entitlement certs 2022-09-08 15:25:57 UTC
Red Hat Issue Tracker RHELPLAN-126375 0 None None None 2022-06-27 16:47:47 UTC
Red Hat Product Errata RHBA-2023:2984 0 None None None 2023-05-16 09:07:36 UTC

Description Martin Kolman 2022-06-27 16:31:15 UTC
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

Comment 5 Jan Stavel 2022-09-22 19:01:41 UTC
a playbook to simulate this case

Comment 6 Jan Stavel 2022-10-11 14:00:44 UTC
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

Comment 9 Jan Stavel 2022-11-14 11:52:17 UTC
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

Comment 12 errata-xmlrpc 2023-05-16 09:07:12 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-2023:2984


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