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.

Ktor client throws JobCancellationException: Parent job is Completed when using compression and logging features

See original GitHub issue

Ktor Version and Engine Used (client or server and name) io.ktor:ktor-client-core-jvm:1.3.2 io.ktor:ktor-client-json-jvm:1.3.2 io.ktor:ktor-client-apache:1.3.1" io.ktor:ktor-client-encoding-jvm:1.3.2 io.ktor:ktor-client-features:1.3.2 io.ktor:ktor-client-serialization-jvm:1.3.2 io.ktor:ktor-client-auth-jvm:1.3.2 io.ktor:ktor-client-logging-jvm:1.3.2

Describe the bug When using the gzip compression feature together with the logging feature (with LogLevel.ALL) the client fails with the kotlinx.coroutines.JobCancellationException: Parent job is Completed exception.

To Reproduce Get ktorGzipTest repository and run log_all_with_gzip test. See also readme in the repo for more details.

Expected behavior The httpClient call ends successfully even when using gzip together with logging all details.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
e5lcommented, May 20, 2021

Could you file a new issue for this bug?

1reaction
e5lcommented, Jun 5, 2020

Hey @avently, the fix is done, but it is not released yet. There is a workaround: You can use:

client.request<HttpStatement>(...).execute { response -> HttpResponse
     val data = response.receive<MyDataClass>()
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ktor fails to deliver response with error: failed with exception ...
Kotlin version 1.5.4. Issue: API Call failed with reason: failed with exception: kotlinx.coroutines.JobCancellationException: Parent job is Completed;.
Read more >
Why tor get this error Parent job is Completed - Stack Overflow
I'm using ktor for the android client but I have an error. When I run the app for the first time everything is...
Read more >
WhatsNew 1.5 | Ktor Framework
Ktor fails to deliver response with error: failed with exception: kotlinx.coroutines.JobCancellationException: Parent job is Completed;.
Read more >
CHANGELOG.md · Gitee 极速下载/Ktor - Gitee.com
Ktor 是一个使用 Kotlin 以最小的成本快速创建 Web 应用程序的框架. ... Client exception is masked by JobCancellationException with Ktor 1.5.0 ...
Read more >
https://raw.githubusercontent.com/ktorio/ktor/mast...
JobCancellationException : Parent job is Completed; ([KTOR-2711](https://youtrack.jetbrains.com/issue/KTOR-2711)) * Replaced kotlin-test dependency with ...
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