bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.66k stars 6.13k forks source link

Glide 4.12.0 Failed to load resource #4619

Open Starner opened 3 years ago

Starner commented 3 years ago

When update from 4.11.0 to 4.12.0 , we find that it couldn't load by accident often individual images, some errors as follows.

2021-08-23 16:55:03.566 26575-26575/com.xiaomi.gamecenter W/Glide: Load failed for http://t1.g.mi.com/thumbnail/webp/w239q90/Wali/149654edabac04b1b839d077cc64db16e03679da0 with size [239x239] class com.bumptech.glide.load.engine.GlideException: Failed to load resource There was 1 root cause: com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE There was 1 root cause: com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed There was 1 root cause: com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1 2021-08-23 16:55:03.566 26575-26575/com.xiaomi.gamecenter I/Glide: Root cause (1 of 1) com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1 at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) Caused by: java.net.SocketTimeoutException: timeout at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:214) at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:263) at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:217) at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307) at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301) at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197) at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:188) at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:129) at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:750) at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:622) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:248) at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:95) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)  at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)  at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)  at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)  at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)  at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)  at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:923)  at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)  Caused by: java.net.SocketException: Socket closed at java.net.SocketInputStream.read(SocketInputStream.java:209) at java.net.SocketInputStream.read(SocketInputStream.java:144) at com.android.okhttp.okio.Okio$2.read(Okio.java:138) at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213) at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)  at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)  at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)  at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:188)  at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:129)  at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:750)  at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:622)  at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)  at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)  at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:248)  at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:95)  at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)  at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)  at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)  at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)  at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)  at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)  at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:923)  at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)  2021-08-23 16:55:03.567 26575-26575/com.xiaomi.gamecenter D/glide: load error:http://t1.g.mi.com/thumbnail/webp/w239q90/Wali/149654edabac04b1b839d077cc64db16e03679da0

Faydee1220 commented 3 years ago

I got same error Failed to connect or obtain data, status code: -1 with any glide version when test Android 12 emulator and found out another solution here: https://medium.com/@mustafayanik/how-to-fix-android-glide-ssl-exception-ab9b2c4dbada

Maybe it's just a workaround solution, but it works for me.

PatilNeosoftTech commented 9 months ago

Facing the same issue on glide:4.12.0

AlexUrrutia commented 8 months ago

@PatilNeosoftTech @Starner Still having the issue on 4.16.0