Bug 626509 - Subscribing to sub-pool, then deleting system consumer results in a deleted subpool
Summary: Subscribing to sub-pool, then deleting system consumer results in a deleted s...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: Entitlement-Beta
TreeView+ depends on / blocked
 
Reported: 2010-08-23 17:31 UTC by chris alfonso
Modified: 2016-02-01 02:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-23 21:51:33 UTC
Embargoed:


Attachments (Terms of Use)

Description chris alfonso 2010-08-23 17:31:30 UTC
Description of problem:

I registered a personal consumer for a customer that has a subscription for Red Hat Personal.  When I register a system consumer using the same username/password, I can list the available Red Hat Personal subscription with RHSM list --avail.  After subscribing to the pool, I see a new sub-pool created, which is expected.  Then if I call the delete consumer api, it deletes the system consumer and it also deletes the sub-pool.  Now when I go back to the client and create a new system consumer and use RHSM to list --avail, I don't see any subscription pools available.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Register a personal consumer
2. Register a system consumer
3. Subscribe to RH Personal subscription
4. Delete system consumer using candlepin delete REST api
5. Use RHSM to create a new system consumer with the same username/password as before
6. Use RHSM to list available pools, and you'll see nothing.
  
Actual results:
No pools are available to subscribe

Expected results:
The same Red Hat Personal subscription should be available.

Additional info:

Comment 1 Bryan Kearney 2010-09-16 12:01:22 UTC
Who do you subscribe with (which consumer0 in step 3?

Comment 2 chris alfonso 2010-09-16 12:10:50 UTC
test7/redhat in hosted.

Comment 3 chris alfonso 2010-09-16 12:19:50 UTC
Steps to Reproduce:
1. Register a personal consumer
2. Subscribe the personal consumer to the RH Personal subscription (this will create the subpool)
2. Register a system consumer using the same username as the person consumer
3. Subscribe the system consumer to RH Personal subscription subpool
4. Delete system consumer using candlepin delete REST api
5. Use RHSM to create a new system consumer with the same username/password as
before
6. Use RHSM to list available pools, and you'll see nothing.

Comment 4 Bryan Kearney 2010-09-20 16:39:05 UTC
Changing to new so folks will pick it up

Comment 5 Dmitri Dolguikh 2010-09-20 16:59:44 UTC
changing back to myself, as i'm working on it...

Comment 6 Jeff Weiss 2010-10-07 17:15:15 UTC
Dmitri when you fix a bug please add a comment listing the git hash of the commit that fixes the bug.  We need that quite often to know whether we can test the fix yet.  Also, it lets us be sure the bug wasn't moved to ON_QA by mistake :)

Comment 7 John Sefler 2010-12-07 20:15:35 UTC
VERSION...
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.2-1.git.82.b7841b3.fc14.x86_64
[root@jsefler-f12-candlepin candlepin]# git show-ref master
5773be9a35b8697e7e53b3ae23fbb38ba881f0e1 refs/heads/master
5773be9a35b8697e7e53b3ae23fbb38ba881f0e1 refs/remotes/origin/master


[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --type=person
2cc32b25-76a0-438e-8177-ab8d1d8021a5 testuser1
[root@jsefler-onprem01 ~]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	RHEL Personal            
ProductId:         	RH09XYU34                
PoolId:            	ff8080812cc18643012cc1871da1018c
Quantity:          	5                        
Expires:           	2011-12-06               


ProductName:       	RHEL Personal            
ProductId:         	RH09XYU34                
PoolId:            	ff8080812cc18643012cc1871dc5018f
Quantity:          	10                       
Expires:           	2011-12-06               

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812cc18643012cc1871da1018c

[root@jsefler-onprem01 ~]# subscription-manager clean
All local data removed

[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --type=system
a2838ae9-3953-4b16-bdbd-61431f7c0a20 testuser1

[root@jsefler-onprem01 ~]# subscription-manager list --available | grep -A5 "Personal Bits"
ProductName:       	RHEL Personal Bits       
ProductId:         	1144                     
PoolId:            	ff8080812cc18643012cc26250640296
Quantity:          	unlimited                
Expires:           	2011-12-06   

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812cc18643012cc26250640296

[root@jsefler-onprem01 ~]# curl -k -u admin:admin -X GET https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/consumers/a2838ae9-393-4b16-bdbd-61431f7c0a20  2>/dev/null | grep username
  "username" : "testuser1",
[root@jsefler-onprem01 ~]# 

[root@jsefler-onprem01 ~]# curl -k -u admin:admin -X delete https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/consumers/a2838ae9-3953-4b16-bdbd-61431f7c0a20
[root@jsefler-onprem01 ~]# curl -k -u admin:admin -X GET https://jsefler-f12-candlepin.usersys.redhat.com:8443/candlepin/consumers/a2838ae9-3953-4b16-bdbd-61431f7c0a20  2>/dev/null | grep username
[root@jsefler-onprem01 ~]# 

[root@jsefler-onprem01 ~]# subscription-manager clean
All local data removed
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --type=system
be4e428b-c100-4a80-bc3d-f118e74dd83b testuser1
[root@jsefler-onprem01 ~]# subscription-manager list --available | grep -A5 "Personal Bits"
ProductName:       	RHEL Personal Bits       
ProductId:         	1144                     
PoolId:            	ff8080812cc18643012cc26250640296
Quantity:          	unlimited                
Expires:           	2011-12-06    

^^^^ SUBPOOL RHEL Personal Bits IS STILL AVAILABLE TO A NEW CONSUMER AFTER HAVING DELETED THE FIRST CONSUMING SYSTEM.

MOVING BUGZILLA TO VERIFIED

will not do some cleanup for the sake of completeness...

[root@jsefler-onprem01 ~]# subscription-manager clean
All local data removed
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --type=system
be4e428b-c100-4a80-bc3d-f118e74dd83b testuser1
[root@jsefler-onprem01 ~]# subscription-manager list --available | grep -A5 "Personal Bits"
ProductName:       	RHEL Personal Bits       
ProductId:         	1144                     
PoolId:            	ff8080812cc18643012cc26250640296
Quantity:          	unlimited                
Expires:           	2011-12-06               

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812cc18643012cc26250640296
[root@jsefler-onprem01 ~]# subscription-manager list --available | grep -A5 "Personal Bits"
[root@jsefler-onprem01 ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	RHEL Personal Bits       
ContractNumber:     	39                       
AccountNumber:      	12331131231              
SerialNumber:       	1129175265119797         
Active:             	True                     
Begins:             	2010-12-06               
Expires:            	2011-12-06               

[root@jsefler-onprem01 ~]# subscription-manager unsubscribe --serial=1129175265119797
[root@jsefler-onprem01 ~]# subscription-manager unregister
System has been un-registered.
[root@jsefler-onprem01 ~]# subscription-manager register --consumerid=2cc32b25-76a0-438e-8177-ab8d1d8021a5 --username=testuser1 --password=password
2cc32b25-76a0-438e-8177-ab8d1d8021a5 testuser1
[root@jsefler-onprem01 ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	RHEL Personal            
ContractNumber:     	39                       
AccountNumber:      	12331131231              
SerialNumber:       	1129175141192087         
Active:             	True                     
Begins:             	2010-12-06               
Expires:            	2011-12-06               

[root@jsefler-onprem01 ~]# subscription-manager unsubscribe --serial=1129175141192087
[root@jsefler-onprem01 ~]# subscription-manager unregister
System has been un-registered.
[root@jsefler-onprem01 ~]#


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