Bug 708058

Summary: Server 500 error thrown when user autosubscribes and has no entitlements
Product: [Community] Candlepin Reporter: Brenton Leanhardt <bleanhar>
Component: candlepinAssignee: William Poteat <wpoteat>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 0.5CC: wpoteat
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: 2012-07-17 13:03:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Brenton Leanhardt 2011-05-26 16:26:02 UTC
Description of problem:
Server 500 errors are showing up in the logs when users try to autosubscribe and have no entitlements.  The symptoms are the same a other errors.  We need to have this improved so that we can properly monitoring production activity.


Version-Release number of selected component (if applicable):
0.3.13

How reproducible:

Steps to Reproduce:
1.  Create a new user
2.  Login to a RHEL 6.1 machine and try to autosubscribe

Here's the command I ran in Stage:
subscription-manager register --username bleanhar_test01 --password redhat --autosubscribe --force

  
Actual results:

The following request was sent from the client to Stage:

https://subscription.rhn.stage.redhat.com/clonepin/candlepin/consumers/f511d11b-f790-4c6f-9b4d-19601d358e7f/entitlements?product=83&product=69&product=85&product=92&product=90

Candlepin returns a server 500 error.  This is in the logs:
2011-05-26 12:07:59,752 INFO  [STDOUT] May 26 12:07:59 [http-10.25.121.1-8080-4] ERROR org.fedoraproject.candlepin.exce
ptions.CandlepinExceptionMapper - Runtime exception:
org.jboss.resteasy.spi.ApplicationException: java.lang.RuntimeException: No entitlements for products: [83, 69, 85, 92,
 90]

Expected results:
A server 500 error is not what should be returned in this case.  Something in the 4xx range might be appropriate.  I could even see it returning a 200 with useful message to the client.  Right now the client silently fails (I believe there is another bug for that)


Additional info:

Comment 1 Brenton Leanhardt 2011-08-15 14:22:25 UTC
*** Bug 728237 has been marked as a duplicate of this bug. ***

Comment 2 Brenton Leanhardt 2011-08-15 14:23:51 UTC
We've seen this autosubscribe call fail 183 times this month.  Users have successfully autosubscribed 595 times during the same time period.

Comment 3 Bryan Kearney 2012-07-17 13:03:32 UTC
Marking all community bugs modified or beyong as closed.