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 1477958 - DBus object Attach does not reflect a changed state of a subscription identity
Summary: DBus object Attach does not reflect a changed state of a subscription identity
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: Jan Stavel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-03 10:14 UTC by Jan Stavel
Modified: 2018-04-10 09:50 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 09:49:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github /RedHatQE rhsm-qe pull 674 0 None None None 2020-06-16 14:29:08 UTC
Github RedHatQE rhsm-qe pull 705 0 None None None 2020-06-16 14:29:08 UTC
Github RedHatQE rhsm-qe pull 706 0 None None None 2020-06-16 14:29:08 UTC
Github RedHatQE rhsm-qe pull 711 0 None None None 2020-06-16 14:29:08 UTC
Github candlepin subscription-manager pull 1706 0 None closed 1477958: Use inotify for checking changes of consumer certs 2020-06-16 14:29:08 UTC
Red Hat Product Errata RHBA-2018:0681 0 None None None 2018-04-10 09:50:47 UTC

Description Jan Stavel 2017-08-03 10:14:19 UTC
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 10:17:43 UTC
I have forgetten add /pools into curl call.

the right url is:

 owners/%s/pools

Comment 3 Jiri Hnidek 2017-08-24 13:12:38 UTC
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 11:32:27 UTC
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 09:43:22 UTC
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.

Comment 7 Shwetha Kallesh 2017-11-14 09:17:39 UTC
Reproducer:

[root@hp-dl380pgen8-02-vm-3 ~]# subscription-manager  version
server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.20.2-1.el7
python-rhsm: 1.20.2-1.el7

[root@hp-dl380pgen8-02-vm-3 ~]# systemctl start rhsm.service
[root@hp-dl380pgen8-02-vm-3 ~]# subscription-manager  list --avail --pool-only
8a99f9865ea4b788015ea511533f03ab
8a99f9875ea4b859015ea4c4c5430129
8a99f9865ea4b788015ea511530003a8
8a99f9875ea4b859015ea4bfe64d0038
8a99f9865ea4b788015ea510f47403a5
8a99f9875ea4b859015ea4c4c878012c
8a99f9865ea4b788015ea510f42d03a2
8a99f9865ea4b788015ea510b7e70396
8a99f9865ea4b788015ea510b82a0399
8a99f9875ea4b859015ea4c22fd500a1
[root@hp-dl380pgen8-02-vm-3 ~]# busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 8a99f9875ea4b859015ea4c22fd500a1 1 0 
as 1 "[{\"startDate\": \"2017-09-21T04:00:00+0000\", \"updated\": \"2017-11-14T09:15:27+0000\", \"endDate\": \"2018-09-21T03:59:59+0000\", \"created\": \"2017-11-14T09:15:26+0000\", \"href\": \"/entitlements/8a99f9865fb609ce015fb9cfd6de36f0\", \"certificates\": [{\"updated\": \"2017-11-14T09:15:26+0000\", \"created\": \"2017-11-14T09:15:26+0000\"

[root@hp-dl380pgen8-02-vm-3 ~]# rct cc /etc/pki/consumer/cert.pem | grep "Subject" -A 1 | grep CN
	CN: 2e152bda-20d2-40e7-affa-852e8ba1da46
[root@hp-dl380pgen8-02-vm-3 ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
System has been unregistered.
[root@hp-dl380pgen8-02-vm-3 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 
The system has been registered with ID: 1d099915-9c68-4b71-b31a-8a3d44d76cdb
The registered system name is: hp-dl380pgen8-02-vm-3.lab.bos.redhat.com
[root@hp-dl380pgen8-02-vm-3 ~]# busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 8a99f9875ea4b859015ea4c22fd500a1 1 0
Unit 2e152bda-20d2-40e7-affa-852e8ba1da46 has been deleted

Comment 8 Shwetha Kallesh 2017-11-14 09:18:57 UTC
Verification:

[root@dhcp35-121 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.2.0-1
subscription management rules: 5.26
subscription-manager: 1.20.5-1.el7


[root@hp-ms-01-c06 ~]# systemctl start rhsm.service

[root@hp-ms-01-c06 ~]# subscription-manager  list --avail --pool-only
8a99f9875ea4b859015ea4bfe64d0038
8a99f9875ea4b859015ea4c22fd500a1
8a99f9865ea4b788015ea511530003a8
8a99f9865ea4b788015ea510f42d03a2
8a99f9865ea4b788015ea510b7e70396

[root@hp-ms-01-c06 ~]# busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 8a99f9875ea4b859015ea4bfe64d0038 1 0

as 1 "[{\"startDate\": \"2017-09-21T04:00:00+0000\", \"updated\": \"2017-11-14T08:17:56+0000\", \"endDate\": \"2018-09-21T03:59:59+0000\", \"created\": \"2017-11-14T08:17:56+0000\", \"href\": \"/entitlements/8a99f9835fb6081f015fb99b31595183\", \"certificates\": [{\"updated\": \"2017-11-14T08:17:56+0000\", \"created\": \"2017-11-14T08:17:56+0000\", 
[root@hp-ms-01-c06 ~]#  rct cc /etc/pki/consumer/cert.pem | grep "Subject" -A 1 | grep CN
	CN: 2c8ee511-3397-4e30-bb71-72ec522552d6
[root@hp-ms-01-c06 ~]# subscription-manager unregister

Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
System has been unregistered.
[root@hp-ms-01-c06 ~]# 
[root@hp-ms-01-c06 ~]# subscription-manager register --username user --password secret
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
^C
User interrupted process.
[root@hp-ms-01-c06 ~]# subscription-manager register --username shwetha_tier1_test
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: eeece0c2-6276-4b5c-8836-a9eac6b9ade6
The registered system name is: hp-ms-01-c06.moonshot1.lab.eng.rdu.redhat.com
[root@hp-ms-01-c06 ~]# busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach PoolAttach asia{sv} 1 8a99f9875ea4b859015ea4bfe64d0038 1 0
as 1 "[{\"startDate\": \"2017-09-21T04:00:00+0000\", \"updated\": \"2017-11-14T08:19:54+0000\", \"endDate\": \"2018-09-21T03:59:59+0000\", \"created\": \"2017-11-14T08:19:54+0000\", \"href\": \"/entitlements/8a99f9865fb609ce015fb99cfe3136cf\", \"certificates\": [{\"updated\": \"2017-11-14T08:19:54+0000\", \"created\": \"2017-11-14T08:19:54+0000\",
[root@hp-ms-01-c06 ~]#

Comment 11 errata-xmlrpc 2018-04-10 09:49:52 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, 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-2018:0681


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