Bug 705900 - not all of the pool's provided products are getting consumed on candlepin 0.3 branch
not all of the pool's provided products are getting consumed on candlepin 0.3...
Status: CLOSED CURRENTRELEASE
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
0.5
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Bryan Kearney
John Sefler
:
Depends On:
Blocks: rhsm-rhel62
  Show dependency treegraph
 
Reported: 2011-05-18 16:12 EDT by John Sefler
Modified: 2015-05-14 11:22 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-30 09:15:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2011-05-18 16:12:28 EDT
Description of problem:
Recently we switched our automated onpremises candlepin tests to deploy candlepin with TESTDATA=1 from the 0.3 branch (previously tested against the 0.2 branch).  After making this switch, some of the subscribe tests are failing.  More specifically when subscribing to a pool whose subscription provides many products, the list of consumed products on the client should show all of the provided products.  However only a few of the provided products are getting consumed.


Version-Release number of selected component (if applicable):
[root@jsefler-f14-5candlepin candlepin]# git branch
  0.2
* 0.3
  master
[root@jsefler-f14-5candlepin candlepin]# git show-ref | grep refs/remotes/origin/0.3
2cb8d0261851b0dc236891b740be06484c9c5aed refs/remotes/origin/0.3


How reproducible:


Steps to Reproduce:
[root@jsefler-onprem-5server ~]# subscription-manager register --username=testuser1 --password=password
1a8a56c6-0861-437c-bc10-6ed324a4da0c jsefler-onprem-5server.usersys.redhat.com
[root@jsefler-onprem-5server ~]# subscription-manager list --avail | grep "awesomeos-server " -B1 -A3
ProductName:       	Awesome OS Server Bundled
ProductId:         	awesomeos-server         
PoolId:            	8a90f8bb3003d8ab013003d95d8c0206
Quantity:          	10                       
Expires:           	05/16/2012               
--
ProductName:       	Awesome OS Server Bundled
ProductId:         	awesomeos-server         
PoolId:            	8a90f8bb3003d8ab013003d95daf020d
Quantity:          	5                        
Expires:           	05/16/2012  
  
[root@jsefler-onprem-5server ~]# subscription-manager subscribe --pool=8a90f8bb3003d8ab013003d95daf020d
[root@jsefler-onprem-5server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	18                       
AccountNumber:      	12331131231              
SerialNumber:       	1278937098376581381      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Management Bits          
ContractNumber:     	18                       
AccountNumber:      	12331131231              
SerialNumber:       	1278937098376581381      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


^^^^ BANG!  I expected this list to include more provided products, and this is why...

If I query the candlepin api for the pool to see the provided products from pool 8a90f8bb3003d8ab013003d95daf020d, I get the following:

[jsefler@jsefler ~]$ curl -k -u testuser1:password --request GET https://jsefler-f14-5candlepin.usersys.redhat.com:8443/candlepin/pools/8a90f8bb3003d8ab013003d95daf020d | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  2137  101  2137    0     0   3221      0 --:--:-- --:--:-- --:--:-- 11551
{
    "accountNumber": "12331131231", 
    "activeSubscription": true, 
    "attributes": [], 
    "consumed": 1, 
    "contractNumber": "18", 
    "created": "2011-05-18T16:03:54.927+0000", 
    "endDate": "2012-05-17T00:00:00.000+0000", 
    "href": "/pools/8a90f8bb3003d8ab013003d95daf020d", 
    "id": "8a90f8bb3003d8ab013003d95daf020d", 
    "owner": {
        "displayName": "admin", 
        "href": "/owners/admin", 
        "id": "8a90f8bb3003d8ab013003d8f1760005", 
        "key": "admin"
    }, 
    "productId": "awesomeos-server", 
    "productName": "Awesome OS Server Bundled", 
    "providedProducts": [
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db00211", 
            "productId": "37067.29", 
            "productName": "Shared Storage Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }, 
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db0020f", 
            "productId": "37069", 
            "productName": "Management Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }, 
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db00210", 
            "productId": "37068.911", 
            "productName": "Large File Support Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }, 
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db0020e", 
            "productId": "37065.1", 
            "productName": "Clustering Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }, 
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db00213", 
            "productId": "37070.2", 
            "productName": "Load Balancing Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }, 
        {
            "created": "2011-05-18T16:03:54.928+0000", 
            "id": "8a90f8bb3003d8ab013003d95db00212", 
            "productId": "37060", 
            "productName": "Awesome OS Server Bits", 
            "updated": "2011-05-18T16:03:54.928+0000"
        }
    ], 
    "quantity": 5, 
    "restrictedToUsername": null, 
    "sourceEntitlement": null, 
    "startDate": "2011-05-18T00:00:00.000+0000", 
    "subscriptionId": "8a90f8bb3003d8ab013003d929e00076", 
    "updated": "2011-05-18T16:03:54.927+0000"
}
[jsefler@jsefler ~]$ 


^^^ Notice that there are six provided products and only two of them are getting consumed.

Maybe this is a clue: I notice that the products that are not getting consumed have a productId containing a dot (e.g. 37070.2 37065.1 37068.911 37067.29).  This is a difference in the TESTDATA between the candlepin 0.2 and 0.3 branch. 



Additional info:

Candlepin Version that IS working...
[root@jsefler-f14-5beakerpin proxy]# git branch
* 0.2
  0.3
  master
[root@jsefler-f14-5beakerpin proxy]# git show-ref | grep refs/remotes/origin/0.2
c9cd85a2c2a052ec5729804b9e8938a7a3944c78 refs/remotes/origin/0.2

For comparison purposes, the equivalent steps against a candlepin 0.2 server look like this:

[root@jsefler-onprem-5server ~]# subscription-manager subscribe --pool=8a90f8e2300487bc01300488768801fa
[root@jsefler-onprem-5server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Clustering Bits          
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Shared Storage Bits      
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Management Bits          
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Large File Support Bits  
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012               


ProductName:        	Load Balancing Bits      
ContractNumber:     	7                        
AccountNumber:      	12331131231              
SerialNumber:       	7432204726261525802      
Active:             	True                     
Begins:             	05/17/2011               
Expires:            	05/16/2012      


[jsefler@jsefler ~]$ curl -k -u testuser1:password --request GET https://jsefler-f14-5beakerpin.usersys.redhat.com:8443/candlepin/pools/8a90f8e2300487bc01300488768801fa | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
103  2076  103  2076    0     0   5989      0 --:--:-- --:--:-- --:--:-- 15609
{
    "accountNumber": "12331131231", 
    "activeSubscription": true, 
    "attributes": [], 
    "consumed": 0, 
    "contractNumber": "7", 
    "created": "2011-05-18T19:15:10.088+0000", 
    "endDate": "2012-05-17T00:00:00.000+0000", 
    "href": "/pools/8a90f8e2300487bc01300488768801fa", 
    "id": "8a90f8e2300487bc01300488768801fa", 
    "owner": {
        "href": "/owners/admin", 
        "id": "8a90f8e2300487bc01300487ec030005"
    }, 
    "productId": "awesomeos-server", 
    "productName": "Awesome OS Server Bundled", 
    "providedProducts": [
        {
            "created": "2011-05-18T19:15:10.090+0000", 
            "id": "8a90f8e2300487bc01300488768a01ff", 
            "productId": "37067", 
            "productName": "Shared Storage Bits", 
            "updated": "2011-05-18T19:15:10.090+0000"
        }, 
        {
            "created": "2011-05-18T19:15:10.090+0000", 
            "id": "8a90f8e2300487bc01300488768a0200", 
            "productId": "37068", 
            "productName": "Large File Support Bits", 
            "updated": "2011-05-18T19:15:10.090+0000"
        }, 
        {
            "created": "2011-05-18T19:15:10.089+0000", 
            "id": "8a90f8e2300487bc01300488768901fc", 
            "productId": "37065", 
            "productName": "Clustering Bits", 
            "updated": "2011-05-18T19:15:10.089+0000"
        }, 
        {
            "created": "2011-05-18T19:15:10.089+0000", 
            "id": "8a90f8e2300487bc01300488768901fb", 
            "productId": "37069", 
            "productName": "Management Bits", 
            "updated": "2011-05-18T19:15:10.089+0000"
        }, 
        {
            "created": "2011-05-18T19:15:10.089+0000", 
            "id": "8a90f8e2300487bc01300488768a01fd", 
            "productId": "37070", 
            "productName": "Load Balancing Bits", 
            "updated": "2011-05-18T19:15:10.089+0000"
        }, 
        {
            "created": "2011-05-18T19:15:10.090+0000", 
            "id": "8a90f8e2300487bc01300488768a01fe", 
            "productId": "37060", 
            "productName": "Awesome OS Server Bits", 
            "updated": "2011-05-18T19:15:10.090+0000"
        }
    ], 
    "quantity": 10, 
    "restrictedToUsername": null, 
    "sourceEntitlement": null, 
    "startDate": "2011-05-18T00:00:00.000+0000", 
    "subscriptionId": "8a90f8e2300487bc0130048832e8006b", 
    "updated": "2011-05-18T19:15:10.088+0000"
}

^^^  Notice for the 0.2 candlepin branch, all of the provided products in the pool got consumed.
Comment 1 William Poteat 2011-06-22 10:59:23 EDT
The issue arose because we tried to use a prefix for custom products. This caused a misreading of the certificate data. 

The prefix use was removed and the issue went away.
Comment 2 John Sefler 2011-06-22 12:31:39 EDT
We are no longer experiencing this problem in our automated test runs against the latest git pulls from candlepin branch 0.3

[root@jsefler-f14-candlepin proxy]# git branch
  0.2
* 0.3
  master
  ownergate
[root@jsefler-f14-candlepin proxy]# git show-ref | grep refs/remotes/origin/0.3
ecdfb9466093cb9b6ea64f32de4a8deb4e113c1a refs/remotes/origin/0.3


Moving to VERIFIED

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