Skip to content
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

Invalid JSON in requests now causes 500 instead of 400 #24630

Closed
rworsnop opened this issue Mar 2, 2020 · 1 comment
Closed

Invalid JSON in requests now causes 500 instead of 400 #24630

rworsnop opened this issue Mar 2, 2020 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@rworsnop
Copy link

rworsnop commented Mar 2, 2020

We just updated to Spring 5.2.4 and are seeing 500 instead of 400 for requests like this:

{
    "bracket_not_closed": [
}

With 5.2.3 we'd see:

{
    "timestamp": "2020-03-02T20:51:06.580+0000",
    "path": "/cards/requests",
    "status": 400,
    "error": "Bad Request",
    "message": "Failed to read HTTP message",
    "requestId": "5ef79eec"
}

With 5.2.4 we see:

{
    "timestamp": "2020-03-02T20:30:13.032+0000",
    "path": "/cards/requests",
    "status": 500,
    "error": "Internal Server Error",
    "message": "JSON conversion problem: Unexpected close marker '}': expected ']' (for Array starting at [Source: (io.netty.buffer.ByteBufInputStream); line: 2, column: 22]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected close marker '}': expected ']' (for Array starting at [Source: (io.netty.buffer.ByteBufInputStream); line: 2, column: 22])\n at [Source: (io.netty.buffer.ByteBufInputStream); line: 4, column: 1] (through reference chain: com.vmware.platform.objects.request.ObjectRequests[\"card_requests\"])",
    "requestId": "5505890a-13"
}

This appears to have been caused by the fix for #24455
I'm not sure if it's exactly the same issue as #24610

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 2, 2020
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 3, 2020
@jhoeller jhoeller self-assigned this Mar 3, 2020
@jhoeller jhoeller added this to the 5.2.5 milestone Mar 3, 2020
@jhoeller
Copy link
Contributor

jhoeller commented Mar 3, 2020

This looks like a variant of that previous report, but there's a specific case here: caused by a plain JsonMappingException. We'll revise our catch blocks for 5.2.5 there, not making assumptions about general JsonMappingException anymore but rather just about Jackson 2.10's new ValueInstantiationException subtype. Thanks for reporting this particular case as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants