Nikky
12/10/2019, 5:04 PMapplication.conf
i have
port = ${PORT}
this works fine on heroku and when this is set in the environment, but can i somehow set eg. 8080
as fallback ?
could not find how to do that in the HOCON specvoben
12/10/2019, 10:50 PMmben
12/11/2019, 5:22 PMBrendan Weinstein
12/12/2019, 3:49 AMMax Raskin
12/13/2019, 1:15 PMktor-client/ktor-client-core/common/src/io/ktor/client/features/DefaultResponseValidation.kt
its name is: ValidateMark
using 1.3.0-beta-2 tag, may I contribute a fix with it annotated as @SharedImmutable
?Cyberpunk Keanu
12/14/2019, 9:49 AMJiri Bruchanov
12/14/2019, 11:51 AM1.3.0-beta-2
on android 4.4 and 5 and probably any other with jvm1.6, because of
java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of '<http://java.io|java.io>.File' appears in /system/framework/core-libart.jar)
also with 1.3.0-beta-1
I'm getting following
ktor-server-netty
java.lang.NoClassDefFoundError: io.ktor.application.ApplicationEvents$subscribe$1
at io.ktor.application.ApplicationEvents.subscribe(ApplicationEvents.kt:22)
at io.ktor.server.engine.BaseApplicationEngine.<init>(BaseApplicationEngine.kt:31)
at io.ktor.server.engine.BaseApplicationEngine.<init>(BaseApplicationEngine.kt:21)
at io.ktor.server.netty.NettyApplicationEngine.<init>(NettyApplicationEngine.kt:27)
at io.ktor.server.netty.Netty.create(Embedded.kt:14)
at io.ktor.server.netty.Netty.create(Embedded.kt:12)
at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:79)
at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:67)
at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:36)
at io.ktor.server.engine.EmbeddedServerKt.embeddedServer$default(EmbeddedServer.kt:34)
at com.scurab.android.anuitor.service.KtorServer.start(KtorServer.kt:50)
....
ktor-server-jetty
MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
hooliooo
12/16/2019, 12:31 PMspand
12/17/2019, 10:38 AMJose A.
12/18/2019, 8:18 AMCristián Arenas
12/18/2019, 3:39 PMUnbound streaming [HttpResponse] is deprecated. Consider using [HttpStatement] instead
Is there a migration guide or something? I don’t see anything relevant in here: https://ktor.io/quickstart/migration/1.3.0.htmlAleksey Chugaev
12/18/2019, 9:16 PMTrying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
kfun:kotlin.Throwable.<init>(kotlin.String?)kotlin.Throwable + 87
kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception + 85
kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException + 85
kfun:kotlin.native.IncorrectDereferenceException.<init>(kotlin.String)kotlin.native.IncorrectDereferenceException + 85
ThrowIncorrectDereferenceException + 137
CheckIsMainThread + 25
kfun:io.ktor.http.<get-URL_ALPHABET_CHARS>#internal + 35
kfun:io.ktor.http.encodeURLPath@kotlin.String.()kotlin.String + 717
kfun:io.ktor.http.takeFromUnsafe$ktor-http@io.ktor.http.URLBuilder.(kotlin.String)io.ktor.http.URLBuilder + 2278
kfun:io.ktor.http.takeFrom@io.ktor.http.URLBuilder.(kotlin.String)io.ktor.http.URLBuilder + 263
My code is
...
withContext(workerDispatcher){
val loginResponse = <http://client.post|client.post><LoginNetworkResponse>("$apiEndpoint/init/auth?v=1") {
contentType(ContentType.Application.Json)
body = LoginNetworkRequest(
...
)
}
....
}
Dmitri Sh
12/20/2019, 1:26 AMsourceSets["watchosMain"].dependencies{
implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61")
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.3")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.14.0")
implementation ("io.ktor:ktor-client-core-native:1.3.0-rc")
implementation ("io.ktor:ktor-client-json-native:1.3.0-rc")
implementation ("io.ktor:ktor-client-serialization-native:1.3.0-rc")
implementation ("io.ktor:ktor-client-ios:1.3.0-rc")
implementation ("io.ktor:ktor-client-cio:1.2.5")
}
spierce7
12/20/2019, 5:28 AMAhsan Raza
12/21/2019, 10:57 AMkevindmoore
12/23/2019, 5:13 AMSabeeh
12/23/2019, 11:53 AMnrobi
12/23/2019, 12:52 PMkotlinx-serialization
? I’m using 0.14.0
, and I’m gettin pretty randomly java.lang.NoClassDefFoundError:
, some time it works, some time it doesn’t 🤷Kris Wong
12/23/2019, 4:35 PMimplementation("ch.qos.logback:logback-classic:1.2.3")
per https://ktor.io/servers/logging.html, but still get the warning SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".spierce7
12/24/2019, 5:08 AMOutgoingContent
.
In the below linked code, the exception is happening inside of the func
parameter after it’s been called. My guess is that at that point the return status code has already been chosen, which is too late, and why the exception handlers are ignored.
https://github.com/ScottPierce/kotlin-html/blob/master/kotlin-html-ktor/src/main/kotlin/dev/scottpierce/html/ktor/RespondHtml.kt#L41-L58
The obvious solution is to write to a StringBuilder
, then give the output String
to the ByteWriteChannel
, instead of writing directly to the ByteWriteChannel
.
I thought I’d ask: Is there is a better way I can handle this that I haven’t considered?jlleitschuh
12/26/2019, 5:49 PMfkrauthan
12/27/2019, 7:41 PMBrendan Weinstein
12/27/2019, 7:51 PMcy
12/29/2019, 8:02 AM1.3.0-rc2
It’s time to test and migrate, the final release is coming after New Year Holidays.
See the migration page: https://ktor.io/quickstart/migration/1.3.0.html
🎄 Please note that we have long New Year Holidays here so no worries if we don’t respond quickly.4ntoine
12/30/2019, 11:36 AMdispatch_get_main_queue()
): https://github.com/ktorio/ktor-samples/blob/86832e4fcfeb4de9da12b2ed3a0eaa0bed9795ab/mpp/client-mpp/src/iosMain/kotlin/io/ktor/samples/mpp/client/Dispatcher.kt#L7 Does it mean all networking (by ktor-client) happens in main thread actually? Android’s in contrast is executed in background thread (pooled) (Dispatchers.Default
): https://github.com/ktorio/ktor-samples/blob/86832e4fcfeb4de9da12b2ed3a0eaa0bed9795ab/mpp/client-mpp/src/main/java/io/ktor/samples/mpp/client/ApplicationDispatcher.kt#L5Steve Young
12/30/2019, 5:52 PMaltavir
12/30/2019, 7:06 PMAdam Hurwitz
12/30/2019, 10:57 PMMikołaj Kąkol
12/31/2019, 11:13 AMio.ktor:ktor-client-auth
ready for native?dave08
12/31/2019, 2:27 PMat 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?dave08
12/31/2019, 2:27 PMat 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?cy
12/31/2019, 3:44 PMbitkid
01/08/2020, 9:40 AMdave08
01/21/2020, 2:58 PM<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?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