coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.84k stars 665 forks source link

HttpUriFetcher.executeNetworkRequest #1606

Closed shlauzer closed 1 year ago

shlauzer commented 1 year ago

Describe the bug 7 non-fatal events in Firebase Crashlytics: Non-fatal Exception: coil.network.HttpException HTTP 504: Unsatisfiable Request (only-if-cached)

To Reproduce Unknown

Logs/Screenshots

Crashlytics - Stack trace

Application: io.breezeventures.mb

Platform: android

Version: 1.5.0-GMS (1084)

Issue: 3af5badb538738135676504199802efd

Session: 63D22F6802020001501F4713EBD376B3_DNE_7_v2

Date: Thu Jan 26 2023 14:50:26 GMT+0700 (Новосибирск, стандартное время)

Non-fatal Exception: coil.network.HttpException: HTTP 504: Unsatisfiable Request (only-if-cached) at coil.fetch.HttpUriFetcher.executeNetworkRequest(HttpUriFetcher.kt:227) at coil.fetch.HttpUriFetcher$executeNetworkRequest$1.r(HttpUriFetcher.kt:14) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Version 2.2.2

colinrtwhite commented 1 year ago

This is likely caused by either manually or automatically disabling fetching the image from the network and it isn't cached locally. The automatic network observer can be disabled by setting networkObserverEnabled(false) if you'd like.

timrijckaert commented 1 month ago

Such option seems unavailable in Coil3? (3.0.0-rc01) We now see crashes in the same trend:

Fatal Exception: coil3.network.HttpException: HTTP 504
       at coil3.network.NetworkFetcher$executeNetworkRequest$2.invokeSuspend(NetworkFetcher.kt:205)
       at coil3.network.NetworkFetcher$executeNetworkRequest$2.invoke(NetworkFetcher.kt:9)
       at coil3.network.NetworkFetcher$executeNetworkRequest$2.invoke(NetworkFetcher.kt:5)
       at coil3.network.okhttp.internal.CallFactoryNetworkClient.executeRequest-impl(utils.kt:25)
       at coil3.network.okhttp.internal.CallFactoryNetworkClient$executeRequest$1.invokeSuspend(utils.kt:11)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

We just use the provided AsyncImage Composable.

I find it a bit odd an image library causes a crash on a failed network request / cache miss.