Bug 1150562
| Summary: | Error is being thrown when to try to add the pool to activationkey second time | ||
|---|---|---|---|
| Product: | [Community] Candlepin (Migrated to Jira) | Reporter: | Shwetha Kallesh <skallesh> |
| Component: | candlepin | Assignee: | Chris "Ceiu" Rog <crog> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 0.5 | CC: | bkearney, crog, dgoodwin |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-07-22 14:39:24 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Additional Info: [root@localhost ~]# curl -k --request GET --user admin:admin https://10.70.35.92:8443/candlepin/activation_keys/ff80808148e5ab950148ef9a6e253234 | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 5793 0 5793 0 0 11623 0 --:--:-- --:--:-- --:--:-- 11609 { "contentOverrides": [], "created": "2014-10-08T11:52:28.453+0000", "description": null, "id": "ff80808148e5ab950148ef9a6e253234", "name": "test", "owner": { "displayName": "Admin Owner", "href": "/owners/admin", "id": "ff80808148e5ab950148e5abaf670003", "key": "admin" }, "pools": [ { "created": "2014-10-08T11:53:20.733+0000", "id": "ff80808148e5ab950148ef9b3a5d3235", "pool": { "accountNumber": "12331131231", "activeSubscription": true, "attributes": [], "branding": [ { "created": "2014-10-06T13:35:38.547+0000", "name": "Branded Awesome OS Instance Based (Standard Support)", "productId": "32060", "type": "OS", "updated": "2014-10-06T13:35:38.547+0000" } ], "calculatedAttributes": null, "consumed": 12, "contractNumber": "5", "created": "2014-10-06T13:35:38.547+0000", "derivedProductAttributes": [], "derivedProductId": null, "derivedProductName": null, "derivedProvidedProducts": [], "endDate": "2015-10-06T00:00:00.000+0000", "exported": 0, "href": "/pools/ff80808148e5ab950148e5ac2a330ef1", "id": "ff80808148e5ab950148e5ac2a330ef1", "orderNumber": "order-8675309", "owner": { "displayName": "Admin Owner", "href": "/owners/admin", "id": "ff80808148e5ab950148e5abaf670003", "key": "admin" }, "productAttributes": [ { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef3", "name": "sockets", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "2" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef4", "name": "arch", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "ALL" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef5", "name": "type", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "MKT" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef6", "name": "version", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "1.0" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef7", "name": "variant", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "ALL" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef8", "name": "multi-entitlement", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "yes" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340ef9", "name": "host_limited", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "true" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efa", "name": "support_level", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "Standard" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efb", "name": "virt_limit", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "1" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efc", "name": "support_type", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "L1-L3" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efd", "name": "stacking_id", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "15" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efe", "name": "instance_multiplier", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "2" } ], "productId": "awesomeos-instancebased", "productName": "Awesome OS Instance Based (Standard Support)", "providedProducts": [ { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340eff", "productId": "32060", "productName": "Awesome OS Instance Server Bits", "updated": "2014-10-06T13:35:38.548+0000" } ], "quantity": 20, "restrictedToUsername": null, "sourceConsumer": null, "sourceEntitlement": null, "sourceStackId": null, "stackId": "15", "stacked": true, "startDate": "2014-10-06T00:00:00.000+0000", "subscriptionId": "ff80808148e5ab950148e5abec090275", "subscriptionSubKey": "master", "type": "NORMAL", "updated": "2014-10-06T13:35:38.547+0000" }, "quantity": 1, "updated": "2014-10-08T11:53:20.733+0000" } ], "releaseVer": { "releaseVer": null }, "serviceLevel": null, "updated": "2014-10-08T11:52:28.453+0000" } We've identified the problem here; but before we start implementing a fix, we're curious what the intended use-case would be for repeated pool additions. Additionally, when you say the pool should be allowed to be added a second time, how would you expect them to be added? Would the quanities be added [1]? Would subsequent additions overwrite the previous [2]? Something else we're not thinking of? Examples: - Pool is added with a quantity of 1 - Pool is added a second time with a quantity of 2 [1] Total quantity after the second addition is 3 (add) [2] Total quantity after the second addition is 2 (overwrite) -C commit c3b4214a5675ad9dcb5308cd230e9f21ad02ed87
Author: Chris Rog <crog>
Date: Mon Dec 1 15:37:45 2014 -0500
1150562: Fixed exception in CP when re-registering a pool/product to activation keys
- CP will no longer throw an exception when a client attempts to add a pool
or product to an activation key multiple times. Instead, a proper error
message is returned to the client.
Moving to closed per the updated candlepin process for bugs that have been merged or have been taken care of. |
Description of problem: Error is being thrown when to try to add the pool to activationkey second time Version-Release number of selected component (if applicable): [root@localhost ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.9.32-1 subscription management rules: 5.11 subscription-manager: 1.13.3-1.el7 python-rhsm: 1.13.2.1-2.el7 How reproducible: Steps to Reproduce: Create an activationkey ------------------------------------------------------------------------------------------------------------- [root@localhost ~]# curl -k --request POST --user admin:admin --data '{"name":"test"}' --header 'accept: application/json' --header 'content-type: application/json' htps://10.70.35.92:8443/candlepin/owners/admin/activation_keys { "id" : "ff80808148e5ab950148ef9a6e253234", "name" : "test", "description" : null, "owner" : { "id" : "ff80808148e5ab950148e5abaf670003", "key" : "admin", "displayName" : "Admin Owner", "href" : "/owners/admin" }, "pools" : [ ], "contentOverrides" : [ ], "releaseVer" : { "releaseVer" : null }, "serviceLevel" : null, "created" : "2014-10-08T11:52:28.453+0000", "updated" : "2014-10-08T11:52:28.453+0000" } Associate a pool to that key ---------------------------------------------------------------------------------------------------------------------------------------- [root@localhost ~]# curl -k --request POST --user admin:admin https://10.70.35.92:8443/candlepin/activation_keys/ff80808148e5ab950148ef9a6e253234/pools/ff80808148e5ab90148e5ac2a330ef1?quantity=1 { "id" : "ff80808148e5ab950148e5ac2a330ef1", "owner" : { "id" : "ff80808148e5ab950148e5abaf670003", "key" : "admin", "displayName" : "Admin Owner", "href" : "/owners/admin" }, "activeSubscription" : true, "sourceEntitlement" : null, "quantity" : 20, "startDate" : "2014-10-06T00:00:00.000+0000", "endDate" : "2015-10-06T00:00:00.000+0000", "productId" : "awesomeos-instancebased", "derivedProductId" : null, "providedProducts" : [ { "id" : "ff80808148e5ab950148e5ac2a340eff", "productId" : "32060", "productName" : "Awesome OS Instance Server Bits", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" } ], "derivedProvidedProducts" : [ ], "attributes" : [ ], "productAttributes" : [ { "id" : "ff80808148e5ab950148e5ac2a330ef3", "name" : "sockets", "value" : "2", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a330ef4", "name" : "arch", "value" : "ALL", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a330ef5", "name" : "type", "value" : "MKT", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a330ef6", "name" : "version", "value" : "1.0", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a330ef7", "name" : "variant", "value" : "ALL", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a330ef8", "name" : "multi-entitlement", "value" : "yes", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340ef9", "name" : "host_limited", "value" : "true", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340efa", "name" : "support_level", "value" : "Standard", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340efb", "name" : "virt_limit", "value" : "1", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340efc", "name" : "support_type", "value" : "L1-L3", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340efd", "name" : "stacking_id", "value" : "15", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" }, { "id" : "ff80808148e5ab950148e5ac2a340efe", "name" : "instance_multiplier", "value" : "2", "productId" : "awesomeos-instancebased", "created" : "2014-10-06T13:35:38.548+0000", "updated" : "2014-10-06T13:35:38.548+0000" } ], "derivedProductAttributes" : [ ], "restrictedToUsername" : null, "contractNumber" : "5", "accountNumber" : "12331131231", "orderNumber" : "order-8675309", "consumed" : 12, "exported" : 0, "productName" : "Awesome OS Instance Based (Standard Support)", "derivedProductName" : null, "branding" : [ { "productId" : "32060", "name" : "Branded Awesome OS Instance Based (Standard Support)", "type" : "OS", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000" } ], "calculatedAttributes" : null, "stacked" : true, "stackId" : "15", "href" : "/pools/ff80808148e5ab950148e5ac2a330ef1", "type" : "NORMAL", "created" : "2014-10-06T13:35:38.547+0000", "updated" : "2014-10-06T13:35:38.547+0000", "sourceStackId" : null, "subscriptionId" : "ff80808148e5ab950148e5abec090275", "sourceConsumer" : null, "subscriptionSubKey" : "master" } Try associating same key again ------------------------------------------------------------------------------------------------------------------------------------------------------------------ [root@localhost ~]# curl -k --request POST --user admin:admin https://10.70.35.92:8443/candlepin/activation_keys/ff80808148e5ab950148ef9a6e253234/pools/ff80808148e5ab90148e5ac2a330ef1?quantity=1 { "displayMessage" : "Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102", "requestUuid" : "d2c4c2f8-4728-4872-9090-8436a3570926" The subscription is still available ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [root@localhost ~]# subscription-manager list --avail | grep Instance -A9 Subscription Name: Awesome OS Instance Based (Standard Support) Provides: Awesome OS Instance Server Bits SKU: awesomeos-instancebased Contract: 4 Pool ID: ff80808148e5ab950148e5ac29570e71 Available: 10 Suggested: 2 Service Level: Standard Service Type: L1-L3 Subscription Type: Instance Based Ends: 10/06/2015 System Type: Physical Subscription Name: Awesome OS Instance Based (Standard Support) Provides: Awesome OS Instance Server Bits SKU: awesomeos-instancebased Contract: 5 Pool ID: ff80808148e5ab950148e5ac2a330ef1 Available: 8 Suggested: 2 Service Level: Standard Service Type: L1-L3 Subscription Type: Instance Based Ends: 10/06/2015 System Type: Physical The pool is multi-entitled and has stacking id too ---------------------------------------------------------------------------------------------------------------------------- [root@localhost ~]# curl -k -u admin:admin https://10.70.35.92:8443/candlepin/pools/ff80808148e5ab950148e5ac2a330ef1 | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4657 0 4657 0 0 6620 0 --:--:-- --:--:-- --:--:-- 6615 { "accountNumber": "12331131231", "activeSubscription": true, "attributes": [], "branding": [ { "created": "2014-10-06T13:35:38.547+0000", "name": "Branded Awesome OS Instance Based (Standard Support)", "productId": "32060", "type": "OS", "updated": "2014-10-06T13:35:38.547+0000" } ], "calculatedAttributes": { "compliance_type": "Instance Based" }, "consumed": 12, "contractNumber": "5", "created": "2014-10-06T13:35:38.547+0000", "derivedProductAttributes": [], "derivedProductId": null, "derivedProductName": null, "derivedProvidedProducts": [], "endDate": "2015-10-06T00:00:00.000+0000", "exported": 0, "href": "/pools/ff80808148e5ab950148e5ac2a330ef1", "id": "ff80808148e5ab950148e5ac2a330ef1", "orderNumber": "order-8675309", "owner": { "displayName": "Admin Owner", "href": "/owners/admin", "id": "ff80808148e5ab950148e5abaf670003", "key": "admin" }, "productAttributes": [ { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef3", "name": "sockets", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "2" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef4", "name": "arch", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "ALL" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef5", "name": "type", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "MKT" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef6", "name": "version", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "1.0" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef7", "name": "variant", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "ALL" }, { "created": "2014-10-06T13:35:38.547+0000", "id": "ff80808148e5ab950148e5ac2a330ef8", "name": "multi-entitlement", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.547+0000", "value": "yes" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340ef9", "name": "host_limited", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "true" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efa", "name": "support_level", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "Standard" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efb", "name": "virt_limit", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "1" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efc", "name": "support_type", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "L1-L3" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efd", "name": "stacking_id", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "15" }, { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340efe", "name": "instance_multiplier", "productId": "awesomeos-instancebased", "updated": "2014-10-06T13:35:38.548+0000", "value": "2" } ], "productId": "awesomeos-instancebased", "productName": "Awesome OS Instance Based (Standard Support)", "providedProducts": [ { "created": "2014-10-06T13:35:38.548+0000", "id": "ff80808148e5ab950148e5ac2a340eff", "productId": "32060", "productName": "Awesome OS Instance Server Bits", "updated": "2014-10-06T13:35:38.548+0000" } ], "quantity": 20, "restrictedToUsername": null, "sourceConsumer": null, "sourceEntitlement": null, "sourceStackId": null, "stackId": "15", "stacked": true, "startDate": "2014-10-06T00:00:00.000+0000", "subscriptionId": "ff80808148e5ab950148e5abec090275", "subscriptionSubKey": "master", "type": "NORMAL", "updated": "2014-10-06T13:35:38.547+0000" } Actual results: Expected results: should be allowed to add the pool second time Additional info: