question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

io.ktor.client.call.ReceivePipelineException with CIO on JVM

See original GitHub issue

Ktor Version

1.1.2

Ktor Engine Used

CIO

JVM Version, Operating System and Relevant Context

JVM Version: 1.8 Operating System: Debian 64bit

Feedback

I have an issue with the ktor-client. It breakes while simply requesting a random website. Other websites are working fine. My code looks like this:

fun main() {
    runBlocking {
        val client = HttpClient(CIO)
        val response = 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:110)
	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:19)
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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
e5lcommented, Jun 24, 2019

Hi @Dallanosm, it should be fixed. Could you recheck it with 1.2.2?

0reactions
e5lcommented, Jul 30, 2019

Closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReceivePipelineException - ktor
ReceivePipelineException. class ReceivePipelineException( val request: HttpClientCall, val info: TypeInfo, val cause: Throwable) : IllegalStateException.
Read more >
Ktor Client CIO engine Jvm ignores Ciphersuites with key ...
The list contains TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 here : · but it is ignored by isSupported method here : · which makes these cipher suites unavailable...
Read more >
Ktor - I generated a new project to try a bit but cannot import ...
When I put import io.ktor.client.engine.cio. ... implementation "io.ktor:ktor-client-core-jvm:$ktor_version" implementation ...
Read more >
客户端 Engines - Ktor
HTTP Client Engines · Default engine · Configuring engines · JVM. Apache; CIO; Jetty · JVM and Android. OkHttp; Android · iOS ·...
Read more >
ktor-client-core-jvm » 1.6.7 - Maven Repository
https://mvnrepository.com/artifact/io.ktor/ktor-client-core-jvm --> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-core-jvm</artifactId> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found