Bug 2067129

Summary: dbus: After subscription attachement EntitlementChanged signal is sent but GetStatus still returns "status: Unknown"
Product: Red Hat Enterprise Linux 7 Reporter: Simon Kobyda <skobyda>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: jstavel, mmarusak, mpitt, mvollmer, redakkan
Target Milestone: rcKeywords: Regression
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: CockpitTest
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-28 10:07:33 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 Simon Kobyda 2022-03-23 11:34:10 UTC
Description of problem:
In our cockpit tests we caught a regression for RHEL 7.9. We listen to a signal EntitlementChanged and when the signal is caught, we fetch the status using GetStatus. However, with a rhel 7.9 update, it seems that after attaching a subscription, the signal is triggered but the GetStatus method still returns "status: Unknown"

Version-Release number of selected component (if applicable):
subscription management server: 4.1.8-1
subscription management rules: 5.43
subscription-manager: 1.24.50-1.el7_

How reproducible:


Steps to Reproduce:
1. Listen to to a RHSM1 signal:
    path: "/com/redhat/RHSM1/Entitlement",
    interface: "com.redhat.RHSM1.Entitlement",
    member: "EntitlementChanged"
and have a callback to fetch subscription status when signal is caught:
    path: "/com/redhat/RHSM1/Entitlement"
    interface: "com.redhat.RHSM1.Entitlement"
    method: "GetStatus"

(Alternatively, you can listen to signals from CLI using: 
$dbus-monitor --system "interface='com.redhat.RHSM1.Entitlement',type='signal'")

2. subscription-manager register --insecure --serverurl [my_url]/candlepin --org=admin --activationkey=[my_key]

3. subscription-manager attach --auto

Actual results:
During/After step 3, a signal EntitlementChanged is caught, but callback GetStatus returns { status: "Unknown", valid: false }

Expected results:
During/After step 3, a signal EntitlementChanged is caught and callback GetStatus should return { status: "Subscribed", valid: true }

Additional info:
After step 3, if I check status manually, subscription-manager correctly says "Subscribed". This leads me to believe that this could be a race condition where the signal EntitlementChanged is triggered before the change is actually finalized, leading to the callback GetStatus fetching the old status of an subscription.

Comment 3 Marius Vollmer 2022-03-25 10:04:18 UTC
Please also see https://bugzilla.redhat.com/show_bug.cgi?id=2030265

Comment 4 Jan Stavel 2022-04-12 14:35:28 UTC
Hello,
I've tried
- open firefox with Subscriptions main page
- dbus-monitor --system
- subscription-manager register --activationkey={{ activation_key }} --org={{ rhsm.org }}
- subscription-manager attach --auto


... no GetStatus appears after an EntitlementChanges signals appears at dbus

A sequence of status field values at Cockpit Subscriptions Page was: 'Invalid', 'Current'

see a list of messages captured at dbus:

1th case (subscription-manager register ....)
 Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=130
  Sender=:1.56  Path=/com/redhat/RHSM1/Consumer  Interface=com.redhat.RHSM1.Consumer  Member=ConsumerChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=131
  Sender=:1.56  Path=/com/redhat/RHSM1/Consumer  Interface=com.redhat.RHSM1.Consumer  Member=ConsumerChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=132
  Sender=:1.56  Path=/com/redhat/RHSM1/Syspurpose  Interface=com.redhat.RHSM1.Syspurpose  Member=SyspurposeChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=6
  Sender=:1.199  Path=/EntitlementStatus  Interface=com.redhat.SubscriptionManager.EntitlementStatus  Member=entitlement_status_changed
  UniqueName=:1.199
  MESSAGE "i" {
          INT32 1;
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=945
  Sender=org.freedesktop.DBus  Path=/org/freedesktop/DBus  Interface=org.freedesktop.DBus  Member=NameOwnerChanged
  MESSAGE "sss" {
          STRING "com.redhat.SubscriptionManager";
          STRING ":1.199";
          STRING "";
  };





2nd case (subscription-manager attach ...)
 Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=141
  Sender=:1.56  Path=/com/redhat/RHSM1/Syspurpose  Interface=com.redhat.RHSM1.Syspurpose  Member=SyspurposeChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=142
  Sender=:1.56  Path=/com/redhat/RHSM1/Syspurpose  Interface=com.redhat.RHSM1.Syspurpose  Member=SyspurposeChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=147
  Sender=:1.56  Path=/com/redhat/RHSM1/Entitlement  Interface=com.redhat.RHSM1.Entitlement  Member=EntitlementChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=148
  Sender=:1.56  Path=/com/redhat/RHSM1/Entitlement  Interface=com.redhat.RHSM1.Entitlement  Member=EntitlementChanged
  UniqueName=:1.56
  MESSAGE "" {
  };

‣ Type=signal  Endian=l  Flags=1  Version=1  Priority=0 Cookie=9
  Sender=org.freedesktop.DBus  Path=/org/freedesktop/DBus  Interface=org.freedesktop.DBus  Member=NameOwnerChanged
  MESSAGE "sss" {
          STRING "org.freedesktop.hostname1";
          STRING ":1.207";
          STRING "";
  };

Comment 5 Jan Stavel 2022-04-12 16:36:13 UTC
I cannot reproduce this bug. in rhel7.9 either in rhel8.7

Comment 7 Rehana 2022-06-28 10:07:33 UTC
Bugzilla backlog clean up:
-------------------------

Thanks for reporting the bug, unfortunately we can not proceed with the troubleshooting on this bug with out the additional details requested. Hence we are closing the bug, please feel free to reach out to us if the issue is still reproducible at your end.

Thanks,
Rehana

Comment 8 Red Hat Bugzilla 2023-09-15 01:53:10 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days