Bug 1268491 - attempts to unbind an extremely large serial number throw a Runtime Error
attempts to unbind an extremely large serial number throw a Runtime Error
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Filip Nguyen
Katello QA List
Depends On:
  Show dependency treegraph
Reported: 2015-10-02 19:03 EDT by John Sefler
Modified: 2016-07-22 10:40 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-22 10:40:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Sefler 2015-10-02 19:03:13 EDT
Description of problem:
I've got an automated test that attempts to unsubscribe from a very large serial number.  The response from candlepin has changed from a gracious response to a RuntimeError

Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.7-1    <============
subscription management rules: 5.17
subscription-manager: 1.15.9-13.el7
python-rhsm: 1.15.4-5.el7

How reproducible:

Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager unsubscribe --serial=41733001809434949198807773539209179904
Serial numbers unsuccessfully removed at the server:
   Runtime Error Unable to extract parameter from http request: javax.ws.rs.PathParam("serial") value is '41733001809434949198807773539209179904' for public void org.candlepin.resource.ConsumerResource.unbindBySerial(java.lang.String,java.lang.Long) at java.lang.NumberFormatException.forInputString:65

Actual results:

Expected results:
Serial numbers unsuccessfully removed at the server:
   41733001809434949198807773539209179904 is not a valid value for serial

Additional info:
Comment 1 Filip Nguyen 2015-10-05 03:23:00 EDT
Good catch John, it seems that the recent transition to new RestEasy affected server-side error handling on our REST layer
Comment 2 Filip Nguyen 2015-10-05 04:45:15 EDT
In the past when a parameter of a JAX-RS resource was not parseable, RestEasy used to throw BadRequestException. This behavior was changed by this REST Easy commit [1]. Now it throws NotFoundException.

[1] https://github.com/resteasy/Resteasy/commit/914f119a6bb06c6abae99229096281b7ea20516f
Comment 4 Barnaby Court 2016-07-22 10:40:12 EDT
Moving to closed per the updated candlepin process for bugs that have been merged or have been taken care of.

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