Bug 624106 - Reregistration blows away consumers entitlements
Reregistration blows away consumers entitlements
Status: CLOSED CURRENTRELEASE
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
0.5
All Linux
low Severity medium
: ---
: ---
Assigned To: Jesus M. Rodriguez
Katello QA List
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-13 12:44 EDT by wes hayutin
Modified: 2017-11-06 11:01 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-11-06 11:01:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description wes hayutin 2010-08-13 12:44:42 EDT
Description of problem:


[root@client01-rhel6-beta2 src]# ./subscription-manager-cli register --username=admin --pass=admin54ce8886-1386-4ee7-95e5-aec6e08b92f0 admin
[root@client01-rhel6-beta2 src]# ./subscription-manager-cli subscribe --pool=1
[root@client01-rhel6-beta2 src]# ls /etc/pki/entitlement/product/
10.pem



[root@client01-rhel6-beta2 src]# ./subscription-manager-cli reregister 
54ce8886-1386-4ee7-95e5-aec6e08b92f0 admin
[root@client01-rhel6-beta2 src]# ls /etc/pki/entitlement/product/
10.pem



[root@client01-rhel6-beta2 src]# mv /etc/pki/consumer/
cert.pem  key.pem   
[root@client01-rhel6-beta2 src]# mv /etc/pki/consumer/cert.pem /bak
mv: overwrite `/bak/cert.pem'? y

[root@client01-rhel6-beta2 src]# ./subscription-manager-cli reregister --username=admin --pass=admin
927899e9-025e-46e9-84e3-d7018c86314a admin
[root@client01-rhel6-beta2 src]# ./subscription-manager-cli list --consumed
No Consumed subscription pools to list
[root@client01-rhel6-beta2 src]# ls /etc/pki/entitlement/product/
[root@client01-rhel6-beta2 src]#
Comment 1 Jesus M. Rodriguez 2010-08-20 16:13:00 EDT
The only way to fix this is to store off the uuid when the register occurs. That way in the event of a corrupt or missing identity certificate, we can register with the old uuid and maintain our subscriptions.
Comment 2 Jesus M. Rodriguez 2010-08-25 15:53:52 EDT
added --consumerid param to reregister

fixed by commits:
7e1e0baa02a28aabf19e4394f06a199287ed50c9
d92eaed9bde595c32f09907ab4d442b8d020da12
Comment 3 John Sefler 2010-09-07 16:56:23 EDT
[root@jsefler-rhel6-client01 ~]# rpm -q subscription-manager
subscription-manager-0.75-1.git.29.c3b1d88.fc12.i386

[root@jsefler-rhel6-client01 ~]# subscription-manager-cli unregister
This system is currently not registered.
[root@jsefler-rhel6-client01 ~]# subscription-manager-cli register --username=admin --pass=admin
7c6d0aac-4cb2-4257-9ea5-748cbc32146d admin
[root@jsefler-rhel6-client01 ~]# subscription-manager-cli subscribe --pool=1
[root@jsefler-rhel6-client01 ~]# ls /etc/pki/entitlement/product/
15.pem


[root@jsefler-rhel6-client01 ~]# subscription-manager-cli reregister
7c6d0aac-4cb2-4257-9ea5-748cbc32146d admin
[root@jsefler-rhel6-client01 ~]# rm /etc/pki/consumer/cert.pem 
rm: remove regular file `/etc/pki/consumer/cert.pem'? y
[root@jsefler-rhel6-client01 ~]# rm /etc/pki/entitlement/product/*.pem
rm: remove regular file `/etc/pki/entitlement/product/15.pem'? y


[root@jsefler-rhel6-client01 ~]# subscription-manager-cli reregister --help
Usage: subscription-manager-cli reregister [OPTIONS]

re-register the client to a Unified Entitlement Platform.

Options:
  -h, --help            show this help message and exit
  --debug=DEBUG         debug level
  --username=USERNAME   specify a username
  --password=PASSWORD   specify a password
  --consumerid=CONSUMERID
                        register to an existing consumer
[root@jsefler-rhel6-client01 ~]# subscription-manager-cli reregister --consumerid=7c6d0aac-4cb2-4257-9ea5-748cbc32146d --username=admin --pass=admin
7c6d0aac-4cb2-4257-9ea5-748cbc32146d admin


VERIFIED: ^^^ Notice that the reregister with the consumerid option returns the same cert hash
Now wait for the rhsmcertd refresh frequency (certFrequency=1) minutes and then...

[root@jsefler-rhel6-client01 ~]# ls /etc/pki/entitlement/product/
15.pem

VERIFIED: ^^^ The product cert is re-dropped

moving to VERIFIED...

Additional Info:
See related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=627685
Comment 4 John Sefler 2011-05-04 10:40:37 EDT
Group move of VERIFIED Candlepin component bugs to RELEASE_PENDING

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