Bug 1477958 - DBus object Attach does not reflect a changed state of a subscription identity
DBus object Attach does not reflect a changed state of a subscription identity
Status: MODIFIED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.4
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Jiri Hnidek
John Sefler
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-03 06:14 EDT by Jan Stavel
Modified: 2017-10-12 13:57 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-31 07:32:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github candlepin/subscription-manager/pull/1706 None None None 2017-09-22 08:08 EDT
Github /RedHatQE/rhsm-qe/pull/674 None None None 2017-08-03 06:20 EDT

  None (edit)
Description Jan Stavel 2017-08-03 06:14:19 EDT
Hello, this is a note to enhance from cockpit perpective mainly.

Steps to reproduce:

   subscription-manager unregister
   subscription-manager register --username XXXXX --password XXXXX --org XXXXX

   curl -k --user XXXX:PASSWD --GET https://CANDLEPIN_URL/PREFIX/owners/ORG_ID
   # ... take 2 pool ids from the response

   # run dbus method for Attach service
   busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 2 8a882d8d5d405f21015d405fa52d018d 8a882d8d5d405f21015d405fa53f0190 3  0 

Actual results:

  "Unit c1e3760e-82a4-49a3-a922-b62c86afeb1c has been deleted\n"

Expected results:

   a list of actually made entitlements


Additional info:

   This can be solved IMHO a few ways:

   - add a sort of advices how to solve the problem into returned message
   aka "Maybe reload your system identity?" And let user reload the app state itself.

   - add a method aka 'reload state' for dbus rhsm service. And let each code (sub-man-cli, sub-man-gui) inform DBus service that a system state has been changed when needed.

   - make all processes use DBus RHSM service. In such case DBus service reloads its state itself when needed since it knows every event that happens in the system.
Comment 2 Jan Stavel 2017-08-03 06:17:43 EDT
I have forgetten add /pools into curl call.

the right url is:

 owners/%s/pools
Comment 3 Jiri Hnidek 2017-08-24 09:12:38 EDT
I'm not able to reproduce this behavior on other machines.

I tried to test it using subscription-manager from:
- git checkout 32ae10e453f8c7e2ab1091b56c0579e06677cf06
- RPMs with subscription-manager version 1.20.1-1
Comment 4 Jiri Hnidek 2017-08-31 07:32:27 EDT
I wasn't able to reproduce it with auto-attach too. I also tested it at another system. I'm closing it now. When this bug will appear during testing then it can be reopened again.
Comment 5 Jiri Hnidek 2017-09-21 05:43:22 EDT
I'm finally able to reproduce this bug, but more steps are necessary:

1. Start rhsm.service (the system has to be already registered to candlepin server):

   $ sudo systemct start rhsm.service

2. Call some D-Bus command to force rhsm.service to save current consumer UUID. You can do it using e.g.:

   $ sudo busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 4028fa7a5ea34597015ea347e6290331 1 0

You can see current consumer UUID using:

   $ rct cc /etc/pki/consumer/cert.pem | grep "Subject" -A 1 | grep CN
   CN: 6908e841-ace7-4fad-a563-324341dd3c5f

3. Unregister system using subscription-manager (not using D-Bus API):

   $ sudo subscription-manager unregister

4. Register system again using subscription-manager (not using D-Bus API):

   $ sudo subscription-manager register --username user --password secret

5. Call some D-Bus command requiring consumer UUID. We can use again previous command:

   $ sudo busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 4028fa7a5ea34597015ea347e6290331 1 0

Actual result:
Unit 6908e841-ace7-4fad-a563-324341dd3c5f has been deleted

Expected result:
System is attached to the subscription.

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