Thread
#kotless
    m

    Mattlangsenkamp

    1 year ago
    Has anyone ever experienced errors that do not occur locally but do occur once deployed? I get this error when trying to run a the sign in mutation, and I don not get this error locally. Cloudfront logging indicated signin succedded but then this error occured when the data was beingreturned. https://github.com/MattLangsenkamp/fnb-serverless-2/blob/picture-upload/src/main/kotlin/fnb/graphql/AuthSchema.kt
    java.lang.IllegalArgumentException: List has more than one element.
    	at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:550)
    	at io.kotless.dsl.ktor.app.KotlessResponse.toHttp(KotlessResponse.kt:73)
    	at io.kotless.dsl.ktor.Kotless$handleRequest$response$1.invokeSuspend(Kotless.kt:80)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:238)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:194)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:144)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
    	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
    	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
    	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:272)
    	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
    	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
    	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    	at io.kotless.dsl.ktor.Kotless.handleRequest(Kotless.kt:54)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at lambdainternal.EventHandlerLoader$StreamMethodRequestHandler.handleRequest(EventHandlerLoader.java:356)
    	at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:902)
    	at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:341)
    	at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:63)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:348)
    	at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:150)
    TanVD

    TanVD

    1 year ago
    In general it is possible, since Kotless is only emulating cloud. But in your case it is definitely bug, I am taking a look