Bug 658683

Summary: additional info would help person consumer to unsubscribe when blocked with "Cannot unbind due to outstanding sub-pool entitlements in ..."
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Chris Duryee <cduryee>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: bkearney, cduryee, shaines
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:37:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 568421    

Description John Sefler 2010-12-01 00:43:05 UTC
Description of problem:

Steps to Reproduce:
https://bugzilla.redhat.com/show_bug.cgi?id=639434#c2

At the end of these reproduction steps, the following message is returned to the user:
Cannot unbind due to outstanding sub-pool entitlements in ff8080812c998809012c99bda59d02ad

Given this message, it is not clear what the user needs to do next in order to achieve his goal of a successful unsubscribe.  Maybe an additional line of output stating what system/username entitlement
ff8080812c998809012c99bda59d02ad was granted to would help the user figure out how to clean the outstanding entitlement that is blocking him from a successful unsubscribe from the personal pool.



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

[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.2-1.git.26.e1db2f8.fc12.i386

Comment 2 Ajay Kumar Nadathur Sreenivasan 2010-12-07 18:16:00 UTC
Fix in: 82784a5221f74864dd9f6859b7858621309b89d2 refs/heads/master

The error message has been improved and is as follows:

Error message when executing unregister:
----------------------------------------

Cannot unregister consumer 'admin' because: 
-Cannot unsubscribe entitlement 'ff8080812cc1d7ed012cc1f81d30025d' because:
  Consumer 'admin' with identity '71609835-4ecf-4b17-b487-4fd99da35823' has the following entitlements:
    Entitlement 'ff8080812cc1d7ed012cc1f88d6d0263':
     account number: '12331131231'
     serial number: '11291744480637153'

The above entitlements were derived from 'ff8080812cc1d7ed012cc1f81d30025d'.
Please unsubscribe from the above entitlements first.

Error message when executing unbind --all/unbind --serial:
----------------------------------------------------------
-Cannot unsubscribe entitlement 'ff8080812cc1d7ed012cc1f81d30025d' because:
  Consumer 'admin' with identity '71609835-4ecf-4b17-b487-4fd99da35823' has the following entitlements:
    Entitlement 'ff8080812cc1d7ed012cc1f88d6d0263':
     account number: '12331131231'
     serial number: '11291744480637153'

The above entitlements were derived from 'ff8080812cc1d7ed012cc1f81d30025d'.
Please unsubscribe from the above entitlements first.

Comment 3 John Sefler 2010-12-07 21:48:30 UTC
VERIFICATION...
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.2-1.git.91.7f89664.fc14.x86_64
[root@jsefler-onprem02 ~]# rpm -q subscription-manager
subscription-manager-0.93.2-1.git.91.7f89664.fc14.x86_64

ON CLIENT1...
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --type=person
3e5b217b-8122-45cc-89d0-03ba1252b046 testuser1
[root@jsefler-onprem01 ~]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


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


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

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812cc27e10012cc27eec5c018d
[root@jsefler-onprem01 ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


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

[root@jsefler-onprem01 ~]#


ON CLINET2...
[root@jsefler-onprem02 ~]# subscription-manager register --username=testuser1 --password=password --type=system --name=CLIENT2
0e27c85c-78c6-42fd-97ea-8d551016d60b CLIENT2
[root@jsefler-onprem02 ~]# subscription-manager list --available | grep "Personal Bits"
ProductName:       	RHEL Personal Bits       
[root@jsefler-onprem02 ~]# subscription-manager list --available | grep -A5 "Personal Bits"
ProductName:       	RHEL Personal Bits       
ProductId:         	1144                     
PoolId:            	ff8080812cc27e10012cc2b141650280
Quantity:          	unlimited                
Expires:           	2011-12-06               

[root@jsefler-onprem02 ~]# subscription-manager subscribe --pool=ff8080812cc27e10012cc2b141650280
[root@jsefler-onprem02 ~]# subscription-manager list --available | grep -A5 "RHEL Workstation"
ProductName:       	RHEL Workstation         
ProductId:         	MKT-rhel-workstation-mkt 
PoolId:            	ff8080812cc27e10012cc27eebee016d
Quantity:          	5                        
Expires:           	2011-12-06               

--
ProductName:       	RHEL Workstation         
ProductId:         	MKT-rhel-workstation-mkt 
PoolId:            	ff8080812cc27e10012cc27eebfd0173
Quantity:          	10                       
Expires:           	2011-12-06               

[root@jsefler-onprem02 ~]# subscription-manager subscribe --pool=ff8080812cc27e10012cc27eebfd0173
[root@jsefler-onprem02 ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


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


ProductName:        	RHEL for Workstations SVC
ContractNumber:     	34                       
AccountNumber:      	12331131231              
SerialNumber:       	11291757215456231        
Active:             	True                     
Begins:             	2010-12-06               
Expires:            	2011-12-06  

BACK ON CLIENT1...

[root@jsefler-onprem01 ~]# subscription-manager unregister
Cannot unregister consumer 'testuser1' because: 
-Cannot unsubscribe entitlement 'ff8080812cc27e10012cc2b14154027f' because:
  Consumer 'CLIENT2' with identity '0e27c85c-78c6-42fd-97ea-8d551016d60b' has the following entitlements:
    Entitlement 'ff8080812cc27e10012cc2b969270289':
     account number: '12331131231'
     serial number: '112917571198144'

The above entitlements were derived from 'ff8080812cc27e10012cc2b14154027f'.
Please unsubscribe from the above entitlements first.


[root@jsefler-onprem01 ~]# subscription-manager unsubscribe --serial=112917565854176

-Cannot unsubscribe entitlement 'ff8080812cc27e10012cc2b14154027f' because:
  Consumer 'CLIENT2' with identity '0e27c85c-78c6-42fd-97ea-8d551016d60b' has the following entitlements:
    Entitlement 'ff8080812cc27e10012cc2b969270289':
     account number: '12331131231'
     serial number: '112917571198144'

The above entitlements were derived from 'ff8080812cc27e10012cc2b14154027f'.
Please unsubscribe from the above entitlements first.


I BELIEVE THIS STATEMENT IS INCORRECT:
The above entitlements were derived from 'ff8080812cc27e10012cc2b14154027f'.

I THINK IT SHOULD BE:
The above entitlements were derived from pool 'ff8080812cc27e10012cc2b141650280'.

MOVING BACK TO ASSIGNED

Comment 4 Ajay Kumar Nadathur Sreenivasan 2010-12-09 18:28:01 UTC
fix is sha: 38ffc7746035f6de0f823c5c25b3c13f458568da

Sample output:
-------------
[ajay@garuda-rh src{master}]$ sm unsubscribe --all

-Cannot unsubscribe entitlement 'ff8080812ccc522d012ccc54241d0248' because:
  Consumer 'admin' with identity '9d00e267-feb5-4f5f-9964-0013c96ed04b' has the following entitlements:
    Entitlement 'ff8080812ccc522d012ccc54b24f0252':
     account number: '12331131231'
     serial number: '11291918291554186'

The above entitlements were derived from the pool: 'ff8080812ccc522d012ccc52f88a018f'.
Please unsubscribe from the above entitlements first.

Comment 5 John Sefler 2010-12-10 16:21:58 UTC
The following blocked message was displayed when a person consumer attempted to unregister after same person subscribed to personal subscription ff8080812cd0f7c9012cd0f8b4e1018f to expose the subpool ff8080812cd0f7c9012cd0f98941024d which four system consumers then subscribed to.

Cannot unregister consumer 'testuser1' because: 
-Cannot unsubscribe entitlement 'ff8080812cd0f7c9012cd0fa5ded025e' because:
  Consumer 'testuser1' with identity '6be94a76-a8d9-4b96-a91e-ef7307126fa5' has the following entitlements:
    Entitlement 'ff8080812cd0f7c9012cd0fae3d8026f':
     account number: '12331131231'
     serial number: '11291996292092161'
  Consumer 'testuser1' with identity '6ea13997-f80a-4a4f-a337-92f23d7d32ad' has the following entitlements:
    Entitlement 'ff8080812cd0f7c9012cd0fb9373027d':
     account number: '12331131231'
     serial number: '1129199633703773'
  Consumer 'testuser1' with identity 'bbbe5157-4ce2-4e95-97eb-ae640b79c53b' has the following entitlements:
    Entitlement 'ff8080812cd0f7c9012cd0fa932a0268':
     account number: '12331131231'
     serial number: '11291996271457205'
  Consumer 'testuser1' with identity '1c8f207e-0cc1-458f-b838-eed5e9d22f21' has the following entitlements:
    Entitlement 'ff8080812cd0f7c9012cd0fb477a0276':
     account number: '12331131231'
     serial number: '11291996317601120'

The above entitlements were derived from the pool: 'ff8080812cd0f7c9012cd0f8b4e1018f'.
Please unsubscribe from the above entitlements first.

VERIFIED.  However, I have one more request before moving to VERIFIED.  See next comment...

Comment 6 John Sefler 2010-12-10 20:15:59 UTC
Because this scenario involves a mixture of "person" and "system" registration types, I recommend changing the verbage of the message above to be more user friendly like this...


CURRENT VERBAGE:
Cannot unregister consumer 'testuser1' because: 
SUGGESTED VERBAGE:
Cannot unregister person consumer 'testuser1' because:
                  ^^^^^^ INSERT THE --type OF THE CURRENT REGISTERER
-Cannot unsubscribe entitlement 'ff8080812cd0f7c9012cd0fa5ded025e' because:
CURRENT VERBAGE:
  Consumer 'testuser1' with identity 'aa' has
the following entitlements:
SUGGESTED VERBAGE:
  system consumer 'testuser1' with identity 'bb' has the following entitlements:
  ^^^^^^ INSERT THE --type OF THE CONSUMER WITH IDENTITY 'bb'
    Entitlement 'ff8080812cd0f7c9012cd0fae3d8026f':
     account number: '12331131231'
     serial number: '11291996292092161'

CURRENT VERBAGE:
The above entitlements were derived from the pool: 'pp'.
Please unsubscribe from the above entitlements first.
SUGGESTED VERBAGE:
These consumed entitlements were derived from subscription pool: 'pp'
You must first unsubscribe these consumers from these entitlements.


Moving back to ASSIGNED

Comment 7 John Sefler 2010-12-10 22:07:38 UTC
*** Bug 658283 has been marked as a duplicate of this bug. ***

Comment 8 Bryan Kearney 2011-01-27 18:51:28 UTC
fixed in 0c5de2eaa8a174287001616e966ef26f5cf1afa5

Comment 9 John Sefler 2011-02-07 21:52:19 UTC
Verifying...
Candlepin server 'jsefler-f12-candlepin.usersys.redhat.com' is running version: 0.1.34
Subscription manager client 'jsefler-onprem01.usersys.redhat.com' is running version: subscription-manager-0.93.15-1.git.13.cdc548a.el6.x86_64


Now, attempt to unregister the person on client 1 from the RHEL Personal pool and assert the unregister is blocked.
ssh root.redhat.com subscription-manager unregister

Stdout:
Cannot unregister person consumer testuser1 because:
-Cannot unsubscribe entitlement {0} because:
system consumer {1} with id {2} has he following entitlements:
Entitlement {0}:
account number: {0}
serial number: {0}
system consumer {1} with id {2} has he following entitlements:
Entitlement {0}:
account number: {0}
serial number: {0}
system consumer {1} with id {2} has he following entitlements:
Entitlement {0}:
account number: {0}
serial number: {0}
system consumer {1} with id {2} has he following entitlements:
Entitlement {0}:
account number: {0}
serial number: {0}

The above entitlements were derived from the pool: {0}.
Please unsubscribe from the above entitlements first.

Stderr:
ExitCode: 255


THE CONSUMER 'TYPES' HAVE BEEN INSERTED INTO THE LOG MESSAGE.  THAT'S GOOD.
Remaining problem: the letter 't' in the phrase 'has he following entitlements' got clobbered.

moving back to ASSIGNED

PS.  I personally like this verbage better for the last two lines:
These consumed entitlements were derived from subscription pool: {0}
You must first unsubscribe these consumers from these entitlements.

Comment 11 Chris Duryee 2011-02-11 20:52:26 UTC
fixed in master, 3597e34

Comment 12 John Sefler 2011-02-17 17:35:48 UTC
VERIFYING VERSION...
[root@jsefler-f14-candlepin proxy]# git branch
* master
[root@jsefler-f14-candlepin proxy]# git show-ref master
b73a5635a8189b5b5a962a4c3a9c69a73f421192 refs/heads/master
2cc34e37691e9e06aad2ad3da394dabc24186ca7 refs/remotes/origin/master


[root@jsefler-onprem03 rhn]# subscription-manager unregister
Cannot unregister person consumer testuser1 because: 
-Cannot unsubscribe entitlement '8a90f8b42e349f20012e34a76157020e' because:
  system consumer 'jsefler-onprem04.usersys.redhat.com' with id '187546b3-4d90-4d43-b689-a4e6c09fae04' has the following entitlements:
    Entitlement '8a90f8b42e349f20012e34a872ab0214':
        account number: '12331131231'
        serial number: '521,297,963,578,060,232'

These consumed entitlements were derived from subscription pool: '8a90f8b42e349f20012e349f9cb40149'.
You must first unsubscribe these consumers from these entitlements.

moving to VERIFIED

Comment 13 errata-xmlrpc 2011-05-19 13:37:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html