-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Handling: Multiple server.log errors indicating http 406 Not Acceptable #7134
Comments
FWIW - datasets/export can produce "application/xml", "application/json", or "application/html". My guess is that if someone makes an API call requesting something other than one of those, it's a 406. |
@qqmeyers @pdurbin Should we try instead of adding more handlers for them whether we can replace lots of 'em by matching on the base class in one handler? Those specific cases of special formating can still be handled by a separate handler... I'm not 100% sure this works, but willing to try. If you want I can look into this tomorrow morning. |
@poikilotherm - refactoring would make sense - even the ones that do custom logging are very similar. (I also don't know if one could simply rethrow from the ThrowableHandler if its one of the WebAppExceptions.) If you have time to try things out tomorrow, I'd say go for it. Thanks! |
…ated code and solve problems like IQSS#7134.
…or ArrayOutOfBoundsException, NullPointerException and ServeletException perfectly replaced by ThrowableHandler. IQSS#7134
…text storage of secrets. IQSS#7134
…e API. IQSS#7134 Only supports error responses for now.
… JSONResponseBuilder for crafting responses and logging. IQSS#7134
…ated code and solve problems like IQSS#7134.
…or ArrayOutOfBoundsException, NullPointerException and ServeletException perfectly replaced by ThrowableHandler. IQSS#7134
…text storage of secrets. IQSS#7134
…e API. IQSS#7134 Only supports error responses for now.
… JSONResponseBuilder for crafting responses and logging. IQSS#7134
As requested by @scolapasta, I created a code only PR #7170 to solve this particular issue. Added a new issue about a bigger sized refactoring in #7171 and add first draft with a docs-first approach in #7172 |
Seeing this in the logs, without tying it to a specific user action, though I am testing the download all api:
[2020-07-22T08:52:30.214+0000] [Payara 5.201] [SEVERE] [] [edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler] [tid: _ThreadID=92 _ThreadName=http-thread-pool::jk-connector(5)] [timeMillis: 1595407950214] [levelValue: 1000] [[
Uncaught REST API exception:
Incident: 39be6b43-cbbf-4dc9-a19a-484f413872a3
URL: https://dataverse-internal.iq.harvard.edu/api/v1/datasets/export?exporter=dcterms&persistentId=doi%3A10.70122%2FFK2%2FEVQ2OH
Method: GET
javax.ws.rs.NotAcceptableException: HTTP 406 Not Acceptable
@qqmyers Has made the following comments:
ThrowableHandler was added prior to #7085. When it was added, it stopped the default handing for exceptions such as javax.ws.rs.NotAcceptableException . What #7085 did was to add more exception/http code-specific handlers to manage the ones Dataverse source throws so that they don't get caught be the new default ThrowableHandler. My guess is that javax.ws.rs.NotAcceptableException is being thrown by the framework code rather than Dataverse source code, so I didn't add a specific handler for it. The fix is probably to just add yet-another handler for this specific exception and just send a 406 response as intended. The Redirect handler is probably a good example.
The text was updated successfully, but these errors were encountered: