Code Monkey home page Code Monkey logo

Comments (10)

Wicpar avatar Wicpar commented on May 29, 2024

https://github.com/papsign/Ktor-OpenAPI-Generator/wiki/A-few-examples#multipart-request

from ktor-openapi-generator.

Groodian avatar Groodian commented on May 29, 2024

Thanks for your reply.
I have already found this but I want to receive a list of images.

Something like this:

@FormDataRequest
data class PatientAddPictures(
    @PartEncoding("image/*")
    val pictures: List<NamedFileInputStream>
)

But this don’t work.

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 29, 2024

You can't have a list of file input streams as a part of type image, right now each part must be named and annotated correctly, you can make them optional though with the nullability. You could make an upload of up to N images each called image1 to imageN in the parameters.

from ktor-openapi-generator.

Groodian avatar Groodian commented on May 29, 2024

Now I am using a binary request, but I get this error:

java.lang.IllegalStateException: Acquiring blocking primitives on this dispatcher is not allowed. Consider using async channel or doing withContext(Dispatchers.IO) { call.receive<InputStream>().use { ... } } instead.

I don’t do anything in the route which is using the binary request.

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 29, 2024

Please identify where the error originates, i don't have the environment to reproduce at the moment.

from ktor-openapi-generator.

Groodian avatar Groodian commented on May 29, 2024
java.lang.IllegalStateException: Acquiring blocking primitives on this dispatcher is not allowed. Consider using async channel or doing withContext(Dispatchers.IO) { call.receive<InputStream>().use { ... } } instead.
	at io.ktor.server.engine.DefaultTransformKt.checkSafeParking(DefaultTransform.kt:93)
	at io.ktor.server.engine.DefaultTransformKt.receiveGuardedInputStream(DefaultTransform.kt:88)
	at io.ktor.server.engine.DefaultTransformKt.access$receiveGuardedInputStream(DefaultTransform.kt:1)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invokeSuspend(DefaultTransform.kt:50)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invoke(DefaultTransform.kt)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invoke(DefaultTransform.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.request.ApplicationReceiveFunctionsKt.receive(ApplicationReceiveFunctions.kt:116)
	at com.papsign.ktor.openapigen.content.type.binary.BinaryContentTypeParser.parseBody(BinaryContentTypeParser.kt:118)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invokeSuspend(OpenAPIRoute.kt:71)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invoke(OpenAPIRoute.kt)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invoke(OpenAPIRoute.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$lambda-4$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$lambda-5$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-6$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.routing.Routing.executeResult(Routing.kt:155)
	at io.ktor.routing.Routing.interceptor(Routing.kt:39)
	at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107)
	at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
	at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:145)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:102)
	at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
	at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:101)
	at io.ktor.features.StatusPages.access$interceptCall(StatusPages.kt:18)
	at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:142)
	at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
	at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:127)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:123)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.startCoroutineImpl(Builders.common.kt:194)
	at kotlinx.coroutines.BuildersKt.startCoroutineImpl(Unknown Source)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:43)
	at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:34)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda-1$lambda-0(NettyApplicationEngine.kt:251)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

from ktor-openapi-generator.

Groodian avatar Groodian commented on May 29, 2024

Do you need more information?

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 29, 2024

Not necessarily, i just don't have the mans to fix that during the holiday season...

from ktor-openapi-generator.

Groodian avatar Groodian commented on May 29, 2024
java.lang.IllegalStateException: Acquiring blocking primitives on this dispatcher is not allowed. Consider using async channel or doing withContext(Dispatchers.IO) { call.receive<InputStream>().use { ... } } instead.
	at io.ktor.server.engine.DefaultTransformKt.checkSafeParking(DefaultTransform.kt:93)
	at io.ktor.server.engine.DefaultTransformKt.receiveGuardedInputStream(DefaultTransform.kt:88)
	at io.ktor.server.engine.DefaultTransformKt.access$receiveGuardedInputStream(DefaultTransform.kt:1)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invokeSuspend(DefaultTransform.kt:50)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invoke(DefaultTransform.kt)
	at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$2.invoke(DefaultTransform.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.request.ApplicationReceiveFunctionsKt.receive(ApplicationReceiveFunctions.kt:116)
	at com.papsign.ktor.openapigen.content.type.binary.BinaryContentTypeParser.parseBody(BinaryContentTypeParser.kt:118)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invokeSuspend(OpenAPIRoute.kt:71)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invoke(OpenAPIRoute.kt)
	at com.papsign.ktor.openapigen.route.OpenAPIRoute$handle$2$2$1$2$1$1.invoke(OpenAPIRoute.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$lambda-5$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$lambda-6$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.routes.PatientRouteKt$patientRoute$lambda-7$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invokeSuspend(Throws.kt:48)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1$1.invoke(Throws.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invokeSuspend(Throws.kt:47)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invoke(Throws.kt)
	at de.h_da.fbi.findus.ApplicationKt$module$7$invoke$$inlined$throws$1.invoke(Throws.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.routing.Routing.executeResult(Routing.kt:155)
	at io.ktor.routing.Routing.interceptor(Routing.kt:39)
	at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107)
	at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
	at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:145)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
	at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:102)
	at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
	at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:101)
	at io.ktor.features.StatusPages.access$interceptCall(StatusPages.kt:18)
	at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:142)
	at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
	at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:127)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
	at io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:123)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.startCoroutineImpl(Builders.common.kt:194)
	at kotlinx.coroutines.BuildersKt.startCoroutineImpl(Unknown Source)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:43)
	at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:34)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda-1$lambda-0(NettyApplicationEngine.kt:251)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

The error occurs on every file upload expect from fileupload in the tests.

from ktor-openapi-generator.

Wicpar avatar Wicpar commented on May 29, 2024

There have been changes in newer versions of ktor that prevent using streams directly on the ktor thread... There is probably a non blocking alternative that is allowed, but the simplest would be to add an array type that just consumes the stream inside the proper io thread like described by the error

from ktor-openapi-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.