Body.size is too long. Expected 497668


#1

Every now and then I get this exception in KTOR.
Looks like the file it is trying to serve is quite big, but not that big.
I wonder what it could be, application servers nowadays should be able to serve half meg pages isn’t it?

2018-06-02 15:29:00.963|nettyWorkerPool-3-7|DefaultEnginePipeline.kt:49:logFailure() - [ERROR] Application: 200 OK: GET - /logs
io.ktor.server.engine.BaseApplicationResponse$BodyLengthIsTooLong: Body.size is too long. Expected 497668
at io.ktor.server.engine.BaseApplicationResponse.ensureLength(BaseApplicationResponse.kt:177)
at io.ktor.server.engine.BaseApplicationResponse.access$ensureLength(BaseApplicationResponse.kt:15)
at io.ktor.server.engine.BaseApplicationResponse$respondFromChannel$2.doResume(BaseApplicationResponse.kt:172)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:53)
at kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run(Dispatched.kt:161)
at kotlinx.coroutines.experimental.AbstractContinuation.run(AbstractContinuation.kt:31)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)


#2

opened an issue: