0

i receive this error from my application in play 2.6.6

[info] c.MyController - URI length exceeds the configured limit of 2048 characters
[error] application - 

! @77gm5oe8k - Internal server error, for (GET) [/api/v1/retrieve] ->

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[JsonParseException: Unrecognized token 'URI': was expecting ('true', 'false' or 'null')
 at [Source: [B@6b37cd3a; line: 1, column: 5]]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:255)
    at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:182)
    at play.filters.cors.AbstractCORSPolicy$$anonfun$1.applyOrElse(AbstractCORSPolicy.scala:122)
    at play.filters.cors.AbstractCORSPolicy$$anonfun$1.applyOrElse(AbstractCORSPolicy.scala:120)
    at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:414)
    at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
    at play.api.libs.streams.Execution$trampoline$.execute(Execution.scala:70)
    at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:68)
    at scala.concurrent.impl.Promise$DefaultPromise.$anonfun$tryComplete$1(Promise.scala:284)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'URI': was expecting ('true', 'false' or 'null')
 at [Source: [B@6b37cd3a; line: 1, column: 5]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3528)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2686)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:878)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:772)
    at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3850)
    at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3772)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2115)
    at play.api.libs.json.jackson.JacksonJson$.parseJsValue(JacksonJson.scala:232)

I have try to insert in application conf this:

akka.actor.http.parsing.max-uri-length=20480

because if I print global config with this command:

play.Play.application.configuration.asMap().toString

I found this configuration:

akka.actor.http.parsing.max-uri-length=2k

If I restart application, after I change conf, and print global conf, I found this situation:

akka.actor.serialization-bindings.http.parsing.max-uri-length= 20480
akka.actor.http.parsing.max-uri-length=2k

Someone has already seen this problem? Thanks

user7200354
  • 11
  • 1
  • 2
  • Does this answer your question? [Play 2.6, URI length exceeds the configured limit of 2048 characters](https://stackoverflow.com/questions/45249694/play-2-6-uri-length-exceeds-the-configured-limit-of-2048-characters) – Julian Pieles Aug 13 '20 at 07:44

1 Answers1

0

By looking at the source of akka-http, the correct config key seems to be: akka.http.parsing.max-uri-length

Frederic A.
  • 3,504
  • 10
  • 17