Bug 624106 - Reregistration blows away consumers entitlements
Summary: Reregistration blows away consumers entitlements
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Jesus M. Rodriguez
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-13 16:44 UTC by wes hayutin
Modified: 2017-11-06 16:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-06 16:01:31 UTC
Embargoed:


Attachments (Terms of Use)

Description wes hayutin 2010-08-13 16:44:42 UTC
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 20:13:00 UTC
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 19:53:52 UTC
added --consumerid param to reregister

fixed by commits:
7e1e0baa02a28aabf19e4394f06a199287ed50c9
d92eaed9bde595c32f09907ab4d442b8d020da12

Comment 3 John Sefler 2010-09-07 20:56:23 UTC
[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 14:40:37 UTC
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.