https://kotlinlang.org logo
#ktor
Title
# ktor
d

dave08

12/31/2019, 2:27 PM
If I try uploading a big ( > 1gig) file to Ktor, I get:
Copy code
at kotlinx.coroutines.DispatchedContinuation.resumeWith(Dispatched.kt:108)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at io.ktor.http.cio.MultipartKt$parseMultipart$1.invokeSuspend(Multipart.kt:319)
at io.ktor.http.cio.MultipartKt.boundary(Multipart.kt:160)
at <http://kotlinx.coroutines.io|kotlinx.coroutines.io>.DelimitedKt.skipDelimiter(Delimited.kt:51)
at <http://kotlinx.coroutines.io|kotlinx.coroutines.io>.DelimitedKt.skipDelimiterSuspend(Delimited.kt:56)
at <http://kotlinx.coroutines.io|kotlinx.coroutines.io>.ByteBufferChannel.lookAheadSuspend(ByteBufferChannel.kt:1828)
at <http://kotlinx.coroutines.io|kotlinx.coroutines.io>.DelimitedKt$skipDelimiterSuspend$2.invoke(Delimited.kt)
at <http://kotlinx.coroutines.io|kotlinx.coroutines.io>.DelimitedKt$skipDelimiterSuspend$2.invokeSuspend(Delimited.kt:58)
<http://java.io|java.io>.IOException: Broken delimiter occurred
what could this mean?
c

cy

12/31/2019, 3:44 PM
Looks like a bug, we have similar reports but no stable repro yet
b

bitkid

01/08/2020, 9:40 AM
i get that too from time to time .. without being able to reproduce it consistently
but even with that info and playing around with the buffer sizes i could not reproduce it
d

dave08

01/21/2020, 2:58 PM
We're still getting this error
<http://java.io|java.io>.IOException: Multipart preamble/prologue limit of 8192 bytes exceeded
on our server logs... anything new about this, or maybe a workaround @cy?
Or maybe this is a different problem? It's the same service that we're trying to upload files to...
On the client side we're getting a ReadTimeout...
On Ktor 1.2.3 (integrated with Micronaut's Ktor plugin -- but Ktor is being used to serve requests...)
Just tried with 1.3.0 and now I'm still getting:
Copy code
2020-01-21 19:04:15	
at java.lang.Thread.run(Thread.java:748)
2020-01-21 19:04:15	
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2020-01-21 19:04:15	
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2020-01-21 19:04:15	
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
2020-01-21 19:04:15	
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
2020-01-21 19:04:15	
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
2020-01-21 19:04:15	
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
2020-01-21 19:04:15	
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
2020-01-21 19:04:15	
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2020-01-21 19:04:15	
at io.ktor.server.netty.cio.RequestBodyHandler$job$1.invokeSuspend(RequestBodyHandler.kt:58)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteWriteChannelKt.close(ByteWriteChannel.kt:165)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.close(ByteBufferChannel.kt:126)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.tryTerminate$ktor_io(ByteBufferChannel.kt:364)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.resumeReadOp(ByteBufferChannel.kt:2184)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.internal.CancellableReusableContinuation.resumeWith(CancellableReusableContinuation.kt:93)
2020-01-21 19:04:15	
at kotlinx.coroutines.DispatchedContinuation.resumeWith(DispatchedContinuation.kt:171)
2020-01-21 19:04:15	
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2020-01-21 19:04:15	
at io.ktor.http.cio.MultipartKt$parseMultipart$1.invokeSuspend(Multipart.kt:319)
2020-01-21 19:04:15	
at io.ktor.http.cio.MultipartKt.boundary(Multipart.kt:160)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.DelimitedKt.skipDelimiter(Delimited.kt:51)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.DelimitedKt.skipDelimiterSuspend(Delimited.kt:56)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.ByteBufferChannel.lookAheadSuspend(ByteBufferChannel.kt:1871)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.DelimitedKt$skipDelimiterSuspend$2.invoke(Delimited.kt)
2020-01-21 19:04:15	
at <http://io.ktor.utils.io|io.ktor.utils.io>.DelimitedKt$skipDelimiterSuspend$2.invokeSuspend(Delimited.kt:58)
2020-01-21 19:04:15	
<http://java.io|java.io>.IOException: Broken delimiter occurred
29 Views