# Body.size is too long. Expected 497668

**URL:** <https://discuss.kotlinlang.org/t/body-size-is-too-long-expected-497668/7992>\
**Category:** Web Development\
**Created:** [June 2, 2018, 1:40pm UTC](https://discuss.kotlinlang.org/t/body-size-is-too-long-expected-497668/7992 "2018-06-02T13:40:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![coder](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/coder/32/4885_2.png) [@coder](https://discuss.kotlinlang.org/u/coder)\
**Post date:** [June 2, 2018, 1:40pm UTC](https://discuss.kotlinlang.org/t/body-size-is-too-long-expected-497668/7992/1 "2018-06-02T13:40:46Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![coder](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/coder/32/4885_2.png) [@coder](https://discuss.kotlinlang.org/u/coder)\
**Post date:** [June 5, 2018, 9:50pm UTC](https://discuss.kotlinlang.org/t/body-size-is-too-long-expected-497668/7992/2 "2018-06-05T21:50:10Z")

</div>

opened an issue:

[https://github.com/ktorio/ktor/issues/431](https://github.com/ktorio/ktor/issues/431)
