Bug 673677 - RFE: RESTful api call to refresh pools for all owners
RFE: RESTful api call to refresh pools for all owners
Status: CLOSED WONTFIX
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
0.5
Unspecified Solaris
unspecified Severity low
: ---
: ---
Assigned To: Bryan Kearney
John Sefler
:
Depends On:
Blocks: rhsm-rhel62
  Show dependency treegraph
 
Reported: 2011-01-29 10:30 EST by John Sefler
Modified: 2015-05-14 11:22 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-18 15:09:23 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-01-29 10:30:16 EST
Description of problem:
While testing in the QA environment, I am getting the following exception while trying to subscribe to an Entitlement Beta personal subscription.

Runtime Error java.lang.IllegalArgumentException: Entitlement #8a9b90882dce731d012dd21af9a904bb 's endDt[2011-07-18 23:59:59.0] must equal Subscription #1978676 's endDt[Mon Jul 18 00:00:00 EDT 2011] at com.google.common.base.Preconditions.checkArgument:111

Version-Release number of selected component (if applicable):
My Observation: This error did not occur for this user in the prior deployment of candlepin version 0.1.30 on the QA environment where this personal subscription was originally created.  Now after the deployment of candlepin 0.1.32 onto the QA environment, I am getting the runtime error from the same user.

[root@jsefler-betaqa-1 ~]# curl -k -u foo:bar https://subscriptions.rhn.webqa.redhat.com:443/subscription/status
{"version":"0.1.32","result":true,"release":"1%{?dist}"}[root@jsefler-betaqa-1 ~]# 


How reproducible:
Everytime with user jsefler-qabetaperson-1, not everytime with a new user.


Steps to Reproduce:
[root@jsefler-betaqa-1 ~]# subscription-manager register --username=jsefler-qabetaperson-1 --password=redhat --type=person
6db12b39-0a89-4f26-b072-c733069d2f5d jsefler-qabetaperson-1
[root@jsefler-betaqa-1 ~]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	Red Hat Enterprise Linux Server Entitlement Beta for
                        Certified Engineers and System Administrators - NOT FOR SALE
ProductId:         	RH3016037                
PoolId:            	8a8aa80d2d960061012d9ff35f0b0579
Quantity:          	1                        
Expires:           	2011-07-18               

[root@jsefler-betaqa-1 ~]# subscription-manager subscribe --pool=8a8aa80d2d960061012d9ff35f0b0579
Runtime Error java.lang.IllegalArgumentException: Entitlement #8a9b90882dce731d012dd21af9a904bb 's endDt[2011-07-18 23:59:59.0] must equal Subscription #1978676 's endDt[Mon Jul 18 00:00:00 EDT 2011] at com.google.common.base.Preconditions.checkArgument:111


Here's a trace from rhsm.log:
2011-01-29 09:08:55,369 [INFO] __init__() @connection.py:297 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2011-01-29 09:08:55,369 [INFO] __init__() @connection.py:300 - Connection Established: host: subscriptions.rhn.webqa.redhat.com, port: 443, handler: /subscription
2011-01-29 09:08:55,477 [DEBUG] __init__() @certlib.py:649 - Sorting product and entitlement cert status for: 2011-01-29 09:08:55.476690
2011-01-29 09:08:55,489 [DEBUG] _populate_all_products() @certlib.py:667 - Installed product IDs: ['3', '5', '4', '7', '6']
2011-01-29 09:08:55,490 [DEBUG] __init__() @certlib.py:658 - valid entitled products: []
2011-01-29 09:08:55,490 [DEBUG] __init__() @certlib.py:659 - expired entitled products: []
2011-01-29 09:08:55,492 [INFO] _request() @connection.py:146 - loading ca pem certificates from: /etc/rhsm/ca/
2011-01-29 09:08:55,492 [INFO] _load_ca_certificates() @connection.py:133 - loading ca certificate '/etc/rhsm/ca/candlepin-stage.pem'
2011-01-29 09:08:55,493 [INFO] _load_ca_certificates() @connection.py:133 - loading ca certificate '/etc/rhsm/ca/fakamai-cp1.pem'
2011-01-29 09:08:55,493 [INFO] _load_ca_certificates() @connection.py:133 - loading ca certificate '/etc/rhsm/ca/redhat-uep.pem'
2011-01-29 09:08:55,494 [INFO] _request() @connection.py:148 - work in insecure mode ?:False
2011-01-29 09:09:34,267 [INFO] _request() @connection.py:176 - status code: 500
2011-01-29 09:09:34,269 [ERROR] _do_command() @managercli.py:440 - Runtime Error java.lang.IllegalArgumentException: Entitlement #8a9b90882dce731d012dd21af9a904bb 's endDt[2011-07-18 23:59:59.0] must equal Subscription #1978676 's endDt[Mon Jul 18 00:00:00 EDT 2011] at com.google.common.base.Preconditions.checkArgument:111
Traceback (most recent call last):
  File "/usr/share/rhsm/managercli.py", line 437, in _do_command
    self.cp.bindByEntitlementPool(consumer, pool)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 385, in bindByEntitlementPool
    return self.conn.request_post(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 202, in request_post
    return self._request("POST", method, params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 177, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 196, in validateResponse
    parsed['displayMessage'])
RestlibException: Runtime Error java.lang.IllegalArgumentException: Entitlement #8a9b90882dce731d012dd21af9a904bb 's endDt[2011-07-18 23:59:59.0] must equal Subscription #1978676 's endDt[Mon Jul 18 00:00:00 EDT 2011] at com.google.common.base.Preconditions.checkArgument:111
Comment 1 John Sefler 2011-01-29 10:32:32 EST
Here's another user whose pools were created during prior deployment of candlepin and is getting the same errors....

[root@jsefler-betaqa-1 ~]# subscription-manager register --username=jsefler-qabetauser-5 --password=redhat
9acb48ac-86a9-4f9f-9082-2939e6524495 jsefler-betaqa-1.usersys.redhat.com
[root@jsefler-betaqa-1 ~]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+


ProductName:       	Red Hat Enterprise Linux Server Entitlement Beta for
                        Certified Engineers and System Administrators - NOT FOR SALE
ProductId:         	RH3036913                
PoolId:            	8a9b90882da9ac9f012dc48fa47b297e
Quantity:          	10                       
Expires:           	2011-07-19               

[root@jsefler-betaqa-1 ~]# subscription-manager subscribe --pool 8a9b90882da9ac9f012dc48fa47b297e
Runtime Error java.lang.IllegalArgumentException: Entitlement #8a9b90882dce731d012dd2634c8304d9 's endDt[2011-07-19 23:59:59.0] must equal Subscription #1978858 's endDt[Tue Jul 19 00:00:00 EDT 2011] at com.google.common.base.Preconditions.checkArgument:111
Comment 2 John Sefler 2011-01-29 10:43:14 EST
Because this error does NOT happen with a brand new user with new pools, I suspect that a simple refresh pools is the fix.

The problem with a simple refresh pools is that the burden is currently on the user, and it's not simple!  He has no idea that he needs to refresh pools AND he has no idea how to refresh pools.  There is no Kingpin, nor subscription-manager client tooling to click a refresh my pools button.

It seems to me that the re-deployment of a newer candlepin version in the QA/Stage/Prod environment must include an automated refresh pool of ALL the existing subscriptions in the candlepin database.  Or something to that effect.
Comment 3 Chris Duryee 2011-02-01 13:35:04 EST
John,

Justin and I were able to reproduce this issue in QA, using jsefler-qabetaperson-1 (owner ID: 6238647). We refreshed the pools for that user, and the issue went away, which proves your hypothesis. We did some basic functionality tests around the subscription, and everything looks correct.

The issue is related to changes in the IT subscription adapter, I would say that the onus is on IT to ensure that pools get refreshed if they make these types of alterations to the adapter.

Let me know if you are okay with this, and we can reassign to msechrest.
Comment 4 John Sefler 2011-02-01 14:45:24 EST
moving back to ASSIGNED and changed Component to IT-Candlepin
Comment 5 John Sefler 2011-02-02 21:26:47 EST
After discussing the causes for this runtime error with msechrest, we both believe that candlepin is working as designed and that this error is really the result of a deficiency in IT's workflow process for rolling out newer versions of candlepin in a Prod/Stage/QA environment: namely the need to refresh all owner pools.  Unfortunately there is currently no single RESTful api call to refresh pools for all owners in candlepin.  Currently, IT would have to make a loop of multiple api calls to candlepin to refresh pools for each owner.  To simplify this process, we are going to flip this bugzilla back onto candlepin as a backlog request for enhancement.

As an IT administrator for candlepin, I would like a RESTful api call to refresh pools for all owners.

moving back to NEW and changed Component to Candlepin
Comment 7 Bryan Kearney 2011-07-18 14:58:50 EDT
Amanda.. Do you have needs for this? If not I agree with Bowes and plan to close this as a WONTFIX.

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