Bug 858286
Summary: | Runtime Error For input string: "zero" at java.lang.NumberFormatException.forInputString:65 | ||
---|---|---|---|
Product: | [Community] Candlepin | Reporter: | John Sefler <jsefler> |
Component: | candlepin | Assignee: | William Poteat <wpoteat> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 0.9 | CC: | bkearney, skallesh, wpoteat |
Target Milestone: | --- | Keywords: | Regression |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-10-01 13:50:49 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: | |||
Bug Depends On: | |||
Bug Blocks: | 840995, 863175, 920191 |
Description
John Sefler
2012-09-18 14:50:54 UTC
Fixed in candlepin master, 0.7.11 (In reply to comment #1) > Fixed in candlepin master, 0.7.11 Are you sure? Problem still exists... [root@jsefler-f14-candlepin candlepin]# git show-ref | grep master d29c9b4a4f61f2db96f91b79630ee2f4c6568899 refs/heads/master [root@jsefler-rhel59 ~]# subscription-manager version registered to: 0.7.11-1 server type: subscription management service subscription-manager: 1.0.19-1.git.11.b6e84e6.el5 python-rhsm: 1.0.8-1.git.1.b3f4b2c.el5 [root@jsefler-rhel59 ~]# subscription-manager list --avail | grep zero -A1 Subscription Name: Awesome OS for systems with sockets value="zero" SKU: zero-sockets Pool Id: 8a90f81d39f09f1c0139f0a5524e0a87 [root@jsefler-rhel59 ~]# subscription-manager subscribe --pool 8a90f81d39f09f1c0139f0a5524e0a87 Runtime Error For input string: "zero" at java.lang.NumberFormatException.forInputString:65 ^^^ BANG! Problem still exists against latest pull from candlepin master. Moving back to ASSIGNED commit was 5c45eb4c The behaviour should be back to what it was with certv3: - A certv1 cert is loosely typed and will take most (all?) data, even if its not right (ie 'zero' sockets). - A certv3 (or 2) cert is strongly typed. the cert itself will only take numeric values for the sockets value. Your client's probably getting a certv3 cert, right? We could give a better error message, but really, the validation has to happen from whoever/whatever populates those values. Probably the IT adapter, or katello. How about we log the problem in candlepin, then set in a default that would match what the certv1 client would have done? (In reply to comment #3) > How about we log the problem in candlepin, then set in a default that would > match what the certv1 client would have done? The person who should really decide what is correct here is the person who decided that certv1 should be loosely typed. Personally I believe that strongly typed attributes is the right approach and will prevent erroneously valued attributes from slipping through the cracks of an overly tolerant candlepin. These types of bugs are hard to find. Hence I vote "no" to logging the problem in candlepin and settting a default that would match what the certv1 client would have done. If my vote counts, then a product with a socket attribute value="zero" (a String) is invalid and should throw an error somewhere (at least the candlepin log) and a pool that provides this product should not become available to the client. Refresh pools should probably skip it and log it to the candlepin log. commit ebff18938b58a4ab87bc4b322f204b2ef45fa81b make that commit dcc2f2235fcf30c6db49ee512e24f3f78bdd89ce Verified!! [root@localhost ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.8.4-1 subscription-manager: 1.8.6-1.el7 python-rhsm: 1.8.9-1.el7 [root@localhost ~]# subscription-manager list --avail | grep 'Zero socket test' -A6 Subscription Name: Zero socket test SKU: Zero-socket-product Pool ID: 8ac6818a3e21268f013e2f82f36d42ed Quantity: 20 Service Level: Service Type: Multi-Entitlement: No [root@localhost ~]# subscription-manager attach --pool 8ac6818a3e21268f013e2f82f36d42ed 1 local certificate has been deleted. Successfully attached a subscription for: Zero socket test [root@localhost ~]# curl -k -u admin:admin https://10.70.35.193:8443/candlepin/pools/8ac6818a3e21268f013e2f82f36d42ed | python -mjson.tool | grep socket -A3 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2453 0 2453 0 0 40815 0 --:--:-- --:--:-- --:--:-- 41576 "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.277+0000", "value": "ALL" }, -- "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.278+0000", "value": "server" }, -- "name": "sockets", "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.278+0000", "value": "0" }, -- "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.278+0000", "value": "1.0" }, -- "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.278+0000", "value": "30" }, -- "productId": "Zero-socket-product", "updated": "2013-04-22T02:11:51.278+0000", "value": "SVC" } -- "productId": "Zero-socket-product", "productName": "Zero socket test", "providedProducts": [ { "created": "2013-04-22T02:11:51.278+0000", |