View Issue Details

IDProjectCategoryView StatusLast Update
0006701libeufinotherpublic2021-01-27 16:11
ReporterMS Assigned ToMS  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Summary0006701: Invalid POSTed JSONs lead to 500 Internal server error.
DescriptionInstead, those errors should respond with some 4xx status code.
Steps To ReproducePOST a payment to /admin/payments at the Sandbox that lacks at least one required field.
TagsNo tags attached.

Activities

MS

2021-01-27 14:56

manager   ~0017417

Now it fails only when the JSON is malformed, throwing this:

14:52:00.892 [eventLoopGroupProxy-4-1] ERROR tech.libeufin.nexus - Uncaught exception while handling '/users'
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'foo': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (InputStreamReader); line: 1, column: 4]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:722)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2868)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2846)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._matchToken2(ReaderBasedJsonParser.java:2643)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._matchToken(ReaderBasedJsonParser.java:2621)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._matchFalse(ReaderBasedJsonParser.java:2595)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:745)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4340)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4189)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3218)
        at io.ktor.jackson.JacksonConverter$convertForReceive$2.invokeSuspend(JacksonConverter.kt:59)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
14:52:00.899 [eventLoopGroupProxy-4-1] DEBUG tech.libeufin.nexus - 500 Internal Server Error: POST - /users

POST anything that's not a valid JSON, in order to reproduce.

MS

2021-01-27 16:11

manager   ~0017419

Last edited: 2021-01-27 16:11

fixed and tested here: 3883732379d0dc00658f186145d6c4cf834a5d21.

Issue History

Date Modified Username Field Change
2021-01-15 11:07 MS New Issue
2021-01-27 14:56 MS Note Added: 0017417
2021-01-27 16:11 MS Note Added: 0017419
2021-01-27 16:11 MS Assigned To => MS
2021-01-27 16:11 MS Status new => resolved
2021-01-27 16:11 MS Resolution open => fixed
2021-01-27 16:11 MS Note Edited: 0017419