Closed ImanX closed 5 years ago
Hi @ImanX, thanks for the report. Could you provide the stacktrace and cause?
Hi @e5l , No because xcode only print log that.
Hey @ImanX and what does it print?
@icarumbas in xcode log just print io.ktor.client.call.ReceivePipelineException: Fail to run receive pipeline
I've got the same error with alike code, and i've noticed that it works with some other sites, for example
"https://stackoverflow.com". I'm not web developer, and i don't know what is difference between google and other sites, but this may help, i think.
io.ktor.client.call.ReceivePipelineException: Fail to run receive pipeline
at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:61)
at io.ktor.client.call.HttpClientCall$receive$1.invokeSuspend(HttpClientCall.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:211)
at io.ktor.util.pipeline.SuspendFunctionGun.access$resumeRootWith(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:114)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:45)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:285)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: kotlinx.coroutines.JobCancellationException: Job was cancelled
I get this after packaging a Ktor API with distZip
, running the binary on a raspberry pi, and trying to fetch an endpoint that makes an http client request. Running locally works. Thought maybe the stack trace would help
(UPDATE: my issue was a timeout error cause it was so slowwww on the Pi)
For the url("https://google.com")
I've got:
Cause: kotlin.IllegalArgumentException: Charset ISO-8859-1 is not supported
It looks like we should find the way to decode ISO-8859-1 in kx.io.
This problem is very similar to #787
Hi, I was trying to follow this below give Kotlin example for Multiplatform: https://medium.com/@aldychris/kotlin-multiplatform-for-ios-and-android-mobile-application-96a753e175f7
I have successfully run it but now I am getting error. Fail to run receive pipeline, after searching a lot and trying to find original exception it seems like it is illegalStateException:
Hey, I got this problem at the JVM.
I use CIO
as my engine on version 1.1.2
and my simple program is JVM based.
Essentially, my code looks like this:
fun main() {
runBlocking {
val client = HttpClient(CIO)
val response = CommonAPI.client.get<String> {
url {
protocol = URLProtocol.HTTPS
host = "playlisten.rbb-online.de"
encodedPath = "/radioberlin/main/index.php"
}
}
println("'$response'")
client.close()
}
}
I get the stack:
Exception in thread "main" io.ktor.client.call.ReceivePipelineException: Fail to run receive pipeline
at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:61)
at io.ktor.client.call.HttpClientCall$receive$1.invokeSuspend(HttpClientCall.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:211)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:186)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:137)
at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:157)
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:23)
at io.ktor.client.call.HttpClientCall.receive(HttpClientCall.kt:55)
at com.molikuner.spotify.MainKt$main$1.invokeSuspend(Main.kt:115)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:211)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:168)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:118)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:45)
at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:211)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:168)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:118)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:45)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:76)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:53)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:35)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.molikuner.spotify.MainKt.main(Main.kt:21)
Caused by: kotlinx.io.charsets.MalformedInputException: Input length = 1
at kotlinx.io.charsets.CharsetJVMKt.throwExceptionWrapped(CharsetJVM.kt:287)
at kotlinx.io.charsets.CharsetJVMKt.decode(CharsetJVM.kt:166)
at kotlinx.io.charsets.EncodingKt.decode(Encoding.kt:104)
at kotlinx.io.core.StringsKt.readText(Strings.kt:339)
at kotlinx.io.core.StringsKt.readText$default(Strings.kt:338)
at io.ktor.client.response.HttpResponseKt.readText(HttpResponse.kt:77)
at io.ktor.client.features.HttpPlainText.read$ktor_client_core(HttpPlainText.kt:23)
at io.ktor.client.features.HttpPlainText$Feature$install$2.invokeSuspend(HttpPlainText.kt:48)
at io.ktor.client.features.HttpPlainText$Feature$install$2.invoke(HttpPlainText.kt)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:278)
... 25 more
I know that the title indicates iOS, but it's pretty similar and the same code works for different websites as described above.
EDIT: changed version
Hi @molikuner, thanks for the report. Could you file the separate issue for that case?
Fixed in 1.1.3.
Hi, I was trying to follow this below give Kotlin example for Multiplatform: https://medium.com/@aldychris/kotlin-multiplatform-for-ios-and-android-mobile-application-96a753e175f7
I have successfully run it but now I am getting error. Fail to run receive pipeline, after searching a lot and trying to find original exception it seems like it is illegalStateException:
Hi Are you able to receive response?
Ktor Version
1.1.1
cio
iOS, Multiplatform
Feedback
I have many issue with
ktor
, I changed behavior my code but I still don't result and response in iOSmy code on common:
and my code on Android that It's work:
and my Code on iOS that not response and print exception:
Where is problem?