Bug 1477958
| Summary: | DBus object Attach does not reflect a changed state of a subscription identity | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jan Stavel <jstavel> |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> |
| Status: | CLOSED ERRATA | QA Contact: | Jan Stavel <jstavel> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.4 | CC: | awood, csnyder, jhnidek, khowell, redakkan, skallesh |
| Target Milestone: | rc | Keywords: | Reopened, Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 09:49:52 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
Jan Stavel
2017-08-03 10:14:19 UTC
I have forgetten add /pools into curl call. the right url is: owners/%s/pools 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 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. 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.
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
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 ~]#
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 |