Bug 748113 - autosubscribe is consuming subscriptions without covering the installed product
Summary: autosubscribe is consuming subscriptions without covering the installed product
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 771481
TreeView+ depends on / blocked
 
Reported: 2011-10-22 03:48 UTC by John Sefler
Modified: 2015-05-14 16:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-18 15:59:42 UTC
Embargoed:


Attachments (Terms of Use)
bug log (10.35 KB, text/plain)
2011-11-07 16:48 UTC, J.C. Molet
no flags Details
json output (27.26 KB, text/plain)
2011-11-07 16:50 UTC, J.C. Molet
no flags Details

Description John Sefler 2011-10-22 03:48:26 UTC
Description of problem:
In the case outlined in the reproduce steps below, I have the candlepin TESTDATA deployed and only one product cert installed (37062.pem) on a ppc64 arch server.  When I run autosubscribe, I expect it to subscribe to the pool "".  Instead it subscribed to numerous other pools and my installed product remains Unsubscribed.  This does not seem correct.  If autosubscribe cannot cover my installed product, then I don't think it should be subscribing to anything.


Version-Release number of selected component (if applicable):
[root@jsefler-onprem-62candlepin candlepin]# git branch
  0.3
* master
[root@jsefler-onprem-62candlepin candlepin]# git show-ref | grep master
9a6c82abd96166cc91fcd4aa9a35fc0e43e5fff4 refs/heads/master
9a6c82abd96166cc91fcd4aa9a35fc0e43e5fff4 refs/remotes/origin/master

How reproducible:


Steps to Reproduce:

[root@jsefler-onprem-62server ~]# subscription-manager facts --list | grep uname.machine
uname.machine: ppc64
[root@jsefler-onprem-62server ~]# subscription-manager facts --list | grep "socket(s)"
cpu.cpu_socket(s): 2
lscpu.cpu_socket(s): 2
[root@jsefler-onprem-62server ~]# ls /etc/pki/product/
37062.pem
[root@jsefler-onprem-62server ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS Premium Architecture Bits
Version:            	6.1                      
Arch:               	ppc64                    
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
No Consumed subscription pools to list
[root@jsefler-onprem-62server ~]# subscription-manager subscribe --auto
Installed Product Current Status:

ProductName:         	Awesome OS Premium Architecture Bits
Status:               	Not Subscribed           

[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Workstation Bits
ContractNumber:     	11                       
AccountNumber:      	12331131231              
SerialNumber:       	8554129631446053882      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS Scalable Filesystem Bits
ContractNumber:     	2                        
AccountNumber:      	12331131231              
SerialNumber:       	1107498463214542433      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits
ContractNumber:     	52                       
AccountNumber:      	12331131231              
SerialNumber:       	304473165232100965       
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for z80/ALL Bits
ContractNumber:     	61                       
AccountNumber:      	12331131231              
SerialNumber:       	7921827851651851118      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for x86_64/ALL Bits for ZERO sockets
ContractNumber:     	54                       
AccountNumber:      	12331131231              
SerialNumber:       	1270008384441061150      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for x86_64/ALL Bits
ContractNumber:     	54                       
AccountNumber:      	12331131231              
SerialNumber:       	1270008384441061150      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Clustering Bits          
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Shared Storage Bits      
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Management Bits          
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Large File Support Bits  
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Load Balancing Bits      
ContractNumber:     	20                       
AccountNumber:      	12331131231              
SerialNumber:       	6634480503151706782      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS Modifier Bits 
ContractNumber:     	1                        
AccountNumber:      	12331131231              
SerialNumber:       	8535101858500394573      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for ia64 Bits 
ContractNumber:     	56                       
AccountNumber:      	12331131231              
SerialNumber:       	6500362771690264605      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for x86 Bits  
ContractNumber:     	56                       
AccountNumber:      	12331131231              
SerialNumber:       	6500362771690264605      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for i386 Bits 
ContractNumber:     	56                       
AccountNumber:      	12331131231              
SerialNumber:       	6500362771690264605      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               


ProductName:        	Awesome OS for ppc64 Bits
ContractNumber:     	56                       
AccountNumber:      	12331131231              
SerialNumber:       	6500362771690264605      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/20/2011               
Expires:            	10/19/2012               

[root@jsefler-onprem-62server ~]# subscription-manager list --installed+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS Premium Architecture Bits
Version:            	6.1                      
Arch:               	ppc64                    
Status:             	Not Subscribed           
Starts:             	                         
Expires: 



^^^^ NOTICE THAT DESPITE ALL OF THE SUBSCRIPTIONS CONSUMED BY AUTOSUBSCRIBE, MY ONLY INSTALLED PRODUCT REMAINS UNSUBSCRIBED.  THAT DOES NOT SEEM CORRECT.

HOWEVER I CAN SUBSCRIBE MANUALLY WITHOUT ANY TROUBLE OR USE OF FILTERS...


[root@jsefler-onprem-62server ~]# subscription-manager list --avail | grep awesomeos-ppc64 -B1 -A3
ProductName:       	Awesome OS for ppc64     
ProductId:         	awesomeos-ppc64          
PoolId:            	8a90f8053329760d0133297777fc037e
Quantity:          	10                       
Multi-Entitlement: 	No                       
--
ProductName:       	Awesome OS for ppc64     
ProductId:         	awesomeos-ppc64          
PoolId:            	8a90f8053329760d0133297778230388
Quantity:          	5                        
Multi-Entitlement: 	No                       
--
ProductName:       	Awesome OS for ppc64     
ProductId:         	awesomeos-ppc64          
PoolId:            	8a90f8053329760d013329777fa304eb
Quantity:          	10                       
Multi-Entitlement: 	No                       
--
ProductName:       	Awesome OS for ppc64     
ProductId:         	awesomeos-ppc64          
PoolId:            	8a90f8053329760d013329777fc704f4
Quantity:          	5                        
Multi-Entitlement: 	No                       
[root@jsefler-onprem-62server ~]# subscription-manager subscribe --pool 8a90f8053329760d0133297777fc037e
Successfully subscribed the system to Pool 8a90f8053329760d0133297777fc037e
[root@jsefler-onprem-62server ~]# subscription-manager list --installed+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS Premium Architecture Bits
Version:            	6.1                      
Arch:               	ppc64                    
Status:             	Subscribed               
Starts:             	10/20/2011               
Expires:            	10/19/2012               

[root@jsefler-onprem-62server ~]# 


SEE ^^^, MANUAL SUBSCRIBE CAN SUCCESSFULLY COVER THE INSTALLED PRODUCT WHILE AUTOSUBSCRIBE COULD NOT.

Comment 1 Adrian Likins 2011-10-25 15:55:18 UTC
[adrian@alikins subscription-manager (master % u=)]$ sudo src/subscription-manager register --username admin --org admin  --force --password admin

The system has been registered with id: c98994f3-47a5-4097-857d-e2c77dbad972

[adrian@alikins subscription-manager (master % u=)]$ sudo src/subscription-manager list --available
...
lots of stuff here
...


[adrian@alikins subscription-manager (master % u=)]$ sudo src/subscription-manager subscribe --auto
Installed Product Current Status:

ProductName:         	Awesome OS Premium Architecture Bits
Status:               	Subscribed               


^THIS LOOKS CORRECT TO ME


[adrian@alikins subscription-manager (master % u=)]$ sudo src/subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	62                       
AccountNumber:      	12331131231              
SerialNumber:       	6417308312316628632      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/24/2011               
Expires:            	10/23/2012               


ProductName:        	Awesome OS Premium Architecture Bits
ContractNumber:     	62                       
AccountNumber:      	12331131231              
SerialNumber:       	6417308312316628632      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/24/2011               
Expires:            	10/23/2012               


^ I THINK THIS IS OKAY TOO


[adrian@alikins subscription-manager (master % u=)]$ sudo src/subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS Premium Architecture Bits
Version:            	6.1                      
Arch:               	ppc64                    
Status:             	Subscribed               
Starts:             	10/24/2011               
Expires:            	10/23/2012               


This seems to be working now. I'm not sure what got changed to fix it however.

Comment 2 John Sefler 2011-11-02 21:06:31 UTC
(In reply to comment #1)

> 
> This seems to be working now. I'm not sure what got changed to fix it however.
>
Agreed...

Verifying Version...

[root@jsefler-onprem-62candlepin candlepin]# git branch
  0.3
* 0.4
  master
[root@jsefler-onprem-62candlepin candlepin]# git show | head -1
commit 7cb7dbe8d5e2892dcbcbf3d77a61541ca221c18f

[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64




[root@jsefler-onprem-62server ~]# subscription-manager facts --list | grep uname.machine
uname.machine: ppc64
[root@jsefler-onprem-62server ~]# subscription-manager facts --list | grep socket
cpu.core(s)_per_socket: 1
cpu.cpu_socket(s): 2
dmi.processor.socket_designation: CPU 1
lscpu.core(s)_per_socket: 1
lscpu.cpu_socket(s): 2
[root@jsefler-onprem-62server ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS Premium Architecture Bits
Version:            	6.1                      
Arch:               	ppc64                    
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
No Consumed subscription pools to list
[root@jsefler-onprem-62server ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: f7e2fd76-cd14-4e67-b487-f5fd8f856ec9 
[root@jsefler-onprem-62server ~]# subscription-manager subscribe --auto
Installed Product Current Status:

ProductName:         	Awesome OS Premium Architecture Bits
Status:               	Subscribed               

[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	65                       
AccountNumber:      	12331131231              
SerialNumber:       	1085545986744288159      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/31/2011               
Expires:            	10/30/2012               


ProductName:        	Awesome OS Premium Architecture Bits
ContractNumber:     	65                       
AccountNumber:      	12331131231              
SerialNumber:       	1085545986744288159      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/31/2011               
Expires:            	10/30/2012               

[root@jsefler-onprem-62server ~]# subscription-manager unregister
System has been un-registered.
[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
No Consumed subscription pools to list
[root@jsefler-onprem-62server ~]# subscription-manager register --username testuser1 --password password --org admin --autosubscribe
The system has been registered with id: b9f887c2-4fcb-45c0-bc90-0cfbff193588 
Installed Product Current Status:

ProductName:         	Awesome OS Premium Architecture Bits
Status:               	Subscribed               

[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	65                       
AccountNumber:      	12331131231              
SerialNumber:       	8141641776989131772      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/31/2011               
Expires:            	10/30/2012               


ProductName:        	Awesome OS Premium Architecture Bits
ContractNumber:     	65                       
AccountNumber:      	12331131231              
SerialNumber:       	8141641776989131772      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/31/2011               
Expires:            	10/30/2012               

[root@jsefler-onprem-62server ~]# 


Moving to VERIFIED

Comment 3 John Sefler 2011-11-03 20:47:20 UTC
I'm not sure what is going on here...
I was just able to reproduce comment 0.  Then while trying to collect the evidence, it started passing again as shown in comment 2.  I'm baffled.

Maybe it has something to do with the covering subscription providing more than one product?...  and the product that i actually have installed (37062) is not the first one in the providedProducts list.  Just guessing... See the pool..


[jsefler@jseflerT5400 ~]$ curl -k -u testuser1:password https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/pools/8a90f805336631120133663281f00359 | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2954    0  2954    0     0   9425      0 --:--:-- --:--:-- --:--:-- 10587
{
    "accountNumber": "12331131231", 
    "activeSubscription": true, 
    "attributes": [], 
    "consumed": 0, 
    "contractNumber": "65", 
    "created": "2011-11-02T21:32:25.968+0000", 
    "endDate": "2012-11-01T00:00:00.000+0000", 
    "href": "/pools/8a90f805336631120133663281f00359", 
    "id": "8a90f805336631120133663281f00359", 
    "owner": {
        "displayName": "Admin Owner", 
        "href": "/owners/admin", 
        "id": "8a90f805336631120133663189530006", 
        "key": "admin"
    }, 
    "productAttributes": [
        {
            "created": "2011-11-02T21:32:25.968+0000", 
            "id": "8a90f805336631120133663281f0035b", 
            "name": "sockets", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.968+0000", 
            "value": "16"
        }, 
        {
            "created": "2011-11-02T21:32:25.968+0000", 
            "id": "8a90f805336631120133663281f0035a", 
            "name": "support_type", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.968+0000", 
            "value": "L1-L3"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f1035e", 
            "name": "arch", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "ppc64"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f1035d", 
            "name": "management_enabled", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "1"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f1035c", 
            "name": "type", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "MKT"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f1035f", 
            "name": "version", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "6.1"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f10360", 
            "name": "support_level", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "Standard"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f20362", 
            "name": "variant", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "ALL"
        }, 
        {
            "created": "2011-11-02T21:32:25.969+0000", 
            "id": "8a90f805336631120133663281f10361", 
            "name": "warning_period", 
            "productId": "awesomeos-ppc-16-socket-std", 
            "updated": "2011-11-02T21:32:25.969+0000", 
            "value": "30"
        }
    ], 
    "productId": "awesomeos-ppc-16-socket-std", 
    "productName": "Awesome OS for Premium Architectures (16 Sockets, L1-L3, Standard Support)", 
    "providedProducts": [
        {
            "created": "2011-11-02T21:32:25.970+0000", 
            "id": "8a90f805336631120133663281f20364", 
            "productId": "37060", 
            "productName": "Awesome OS Server Bits", 
            "updated": "2011-11-02T21:32:25.970+0000"
        }, 
        {
            "created": "2011-11-02T21:32:25.970+0000", 
            "id": "8a90f805336631120133663281f20363", 
            "productId": "37062", 
            "productName": "Awesome OS Premium Architecture Bits", 
            "updated": "2011-11-02T21:32:25.970+0000"
        }
    ], 
    "quantity": 10, 
    "restrictedToUsername": null, 
    "sourceEntitlement": null, 
    "startDate": "2011-11-02T00:00:00.000+0000", 
    "subscriptionId": "8a90f80533663112013366326fbc024f", 
    "updated": "2011-11-02T21:32:25.968+0000"
}
[jsefler@jseflerT5400 ~]$

Comment 4 J.C. Molet 2011-11-07 16:48:29 UTC
Created attachment 532095 [details]
bug log

Reopening this bug, I am running into the error as well:

[root@mgmt5 candlepin]# git branch
  0.2
  0.3
* 0.4
  BETA
  master
  ownergate
[root@mgmt5 candlepin]# git show
commit 7cb7dbe8d5e2892dcbcbf3d77a61541ca221c18f
Author: jesus m. rodriguez <jesusr>
Date:   Fri Oct 28 17:02:41 2011 -0400


Client box only contains 37062.pem 

Autosubscribe does not get this product in "Green" status, although there are 4 products out there that satisfy it.  Attached here is the shell steps I took.

Comment 5 J.C. Molet 2011-11-07 16:50:34 UTC
Created attachment 532096 [details]
json output

Attached here is the json output for all the pools that SHOULD satisfy this product and put it in green status (as seen from the test preformed in the above comment).

Comment 7 William Poteat 2012-12-18 15:59:42 UTC
Test data has changed since bug was filed. Not able to reproduce.


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