glide icon indicating copy to clipboard operation
glide copied to clipboard

setDataSourceCallback failed: status = 0x80000000

Open bumdream opened this issue 4 years ago • 15 comments

hi. I'm SeungBeom :) First of all, thank you so much for making a great library. Our app uses this library well.

I've already checked same other issues here. (like https://github.com/bumptech/glide/issues/980, https://github.com/bumptech/glide/issues/4254, https://github.com/bumptech/glide/issues/3345) But I don't get much help, so I submit new issue.

(I used a translator because I am not good at English. Please understand.)

Issue details / Repro steps / Use case background:

Glide Version: 4.12.0 Device/Android Version: multiple version or devices encountered problems

log

com.bumptech.glide.load.o.q: Failed to load resource
There were 8 causes:
java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0x80000000)
 call GlideException#logRootCauses(String) for more detail

It doesn't happen to all users, but it happens to about 5,000 people a day. (The average daily user is 2 million.)

Glide Setting Environment

  • DiskCacheStrategy.DATA
  • skipMemoryCache(false) -> default
  • use okhttp3 (but not using okhttp cache)

The steps we've taken

  • Guessing and reproducing Issue
    • image
    • 0x80000000 issue could be reproduced by changing the contents of a *.0-type file stored in the cache path.
    • When I changed the contents, the same issue error occurred so, we assumed that the main cause was corrupted disk cache.
  • use signature
    • image
    • we increased the preference every time a problem occurs, and we use it as a signature.
      • why signature?
        • we found that it is difficult to delete the cache directly with uri or url. (link)
        • In Addition, using DiskLruCacheWrapper class, we knew it was possible to remove cache with the key with remove method, but we found an exception case that did not resolve the issue in that way. So we finally used signature.
  • The issue seemed to have been resolved! so we provided the modified version to the customer.
  • but the problem was not solved. the user experienced the same issue, although the signature increased several times. we thought maybe it wasn't about Disk Cache..

Question

  • I wonder if there is another situation where 0x80000000 issue can occur.
  • Is there anything I missed or I can try?

Thank you for reading it.

bumdream avatar Feb 03 '21 07:02 bumdream

Hi, I'm also having the same issue.

On devices with the issue I'm seeing the following error in the logs as well as what is provided by @HanSeungBeom :

D/skia: --- Failed to create image decoder with message 'unimplemented'

class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}

seems related to https://github.com/android/uamp/issues/354

MateoVakili avatar Feb 03 '21 19:02 MateoVakili

After taking a look at the issue I'm seeing that when I'm on the wifi connection the images load just fine however with data connection the same error occurs. the data connection is 4G and there is no issue with my connection speed.

MateoVakili avatar Feb 06 '21 15:02 MateoVakili

@MateoVakili Thank you for sharing the issue. :)

After taking a look at the issue I'm seeing that when I'm on the wifi connection the images load just fine however with data connection the same error occurs. the data connection is 4G and there is no issue with my connection speed.

It doesn't seem to matter if it's 4g or WIFI. There are more Wi-Fi users in our app who have experienced problems.

bumdream avatar Feb 08 '21 00:02 bumdream

+1 unfortuanately( Glide Version: 4.12.0

2021-03-16 18:08:40.070 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.071 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.079 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.079 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.094 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.099 27814-27900/com.sample.package I/chatty: uid=11668(com.sample.package) glide-source-th identical 4 lines
2021-03-16 18:08:40.101 27814-27900/com.sample.package D/skia: --- SkAndroidCodec::NewFromStream returned null
2021-03-16 18:08:40.103 1009-1009/? I/ExtendedUtils: printFileName fd(11) -> /data/data/com.sample.package/cache/image_manager_disk_cache/ba46fe404c104d7b3080517b33be79cfa4d07d7810ae9100864157942b7dc30e.0
2021-03-16 18:08:40.109 1009-2193/? I/ExtendedUtils: printFileName fd(11) -> /data/data/com.sample.package/cache/image_manager_disk_cache/ba46fe404c104d7b3080517b33be79cfa4d07d7810ae9100864157942b7dc30e.0
2021-03-16 18:08:40.122 27814-27814/com.sample.package W/Glide: Load failed for [url] with size [300x300]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 4 root causes:
    java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
    java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
    java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
    java.lang.RuntimeException(setDataSource failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, REMOTE, http://valid_and_worked_Url.here

I am also use glide in other application for loading images from the same domain, but without view binding in recyclerview - all works. Probably, this is view binding-spesific error? @HanSeungBeom did you use view binding?

vellrya avatar Mar 16 '21 15:03 vellrya

Probably, this is view binding-spesific error? @HanSeungBeom did you use view binding?

@vellrya

  • Using viewbinding means load images from xml through data binding? (like app:glideSrc:@{uri})
    • no. We do not use databinding to load images, we use CustomTarget. We also make our ModelLoader and DataFetcher for image decoding processing.

bumdream avatar Apr 07 '21 01:04 bumdream

Maybe because the image url contains unicode value which will be converted to character,such as "https://timgsa.baidu.com/timg?image\u0026quality\u003d80\u0026size\u003db9999_10000\u0026sec\u003d1598539200003\u0026di\u003ddf074fd0b29e2bc8df514587fa59e224\u0026imgtype\u003d0\u0026src\u003dhttp%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202008%2F09%2F20200809145546_tfrdx.thumb.400_0.jpeg" turn into "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1598539200003&di=df074fd0b29e2bc8df514587fa59e224&imgtype=0&src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202008%2F09%2F20200809145546_tfrdx.thumb.400_0.jpeg". But don't know why.

BIGMONK avatar Apr 21 '21 11:04 BIGMONK

2021-07-07 09:42:41.958 8281-8281/****************** I/Glide: Root cause (6 of 8) java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000 at android.media.MediaMetadataRetriever._setDataSource(Native Method) at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:223) at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ByteBufferInitializer.initialize(VideoDecoder.java:324) at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ByteBufferInitializer.initialize(VideoDecoder.java:318) at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173) at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:58) at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92) at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70) at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59) at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76) at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57) at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:529) at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:493) at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:479) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:430) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:394) at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:176) at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:94) at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:62) at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:74) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:50) 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:764) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) its repeating error, I do not know why this is happeneng.

any solutions?

neo-turak avatar Jul 07 '21 01:07 neo-turak

Hello, this is happening to me. In my case I am just retrieving some pokemon images. The url I am using: https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/other/official-artwork/1.png -> I can access it on the browser, but Glide cannot load this image. I tried to load images from a different site (just to discard some network issue) and worked ok. Getting same status code: 0x80000000

java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000
      Cause (2 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, DATA_DISK_CACHE, https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/other/official-artwork/1.png
        Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
        Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
        Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
      Cause (3 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, DATA_DISK_CACHE, https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/other/official-artwork/1.png

I was wondering, but, could be the cause that the url contains uppercase characters?

IgnacioGarcia198 avatar Dec 08 '21 12:12 IgnacioGarcia198

Same here:

java.io.IOException: java.lang.IllegalArgumentException: setDataSource failed: status = 0x80000000 at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173) at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:58) at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72) at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55) at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45) at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58) at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43) at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:515) at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:480) at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:466) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387) at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:135) at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95) at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:76) at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:49) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387) at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:135) at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95) at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:76) at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:49) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387) at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:135) at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95) at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:74) at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:49) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279) 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:929) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446) Caused by: java.lang.IllegalArgumentException: setDataSource failed: status = 0x80000000

StringMeUp avatar Dec 08 '21 12:12 StringMeUp

Guys I think I finally understood the problem! The real issue seems to be that the url is not pointing directly to an image. Example: In my case, I was using url https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/other/official-artwork/1.png , but when I click to download this image, it takes me to https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/1.png -> Using this url actually works.

I also found a trick: Try to do this: curl url and see the output:

  • If you see a lot of code, that is probably a web page or so.
  • I you see something like this:
Warning: Binary output can mess up your terminal. Use "--output -" to tell 
Warning: curl to output it to your terminal anyway, or consider "--output 
Warning: <FILE>" to save to a file.

-> That is an image. I believe there must be better ways to assert this, but anyway.

I got the clue from here (just use some translator): https://blog.csdn.net/u012894648/article/details/115465522

IgnacioGarcia198 avatar Dec 08 '21 12:12 IgnacioGarcia198

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 17:01 stale[bot]

@IgnacioGarcia198 you are right,help me a lot!add a tip:clear the cache first

nicelyjust avatar Dec 23 '22 09:12 nicelyjust

I got this error too, because the image content error. The content type of image response is image/webp, but actual it is a gif. https://img101.urbanic.com/v1/aa8160c6f1414db3bf128292973c1389.webp

xckevin avatar May 25 '23 09:05 xckevin

i got the same error and the imageUrl is https://head.miyiapp.com/android/781015001706435046968.jpg?x-oss-process=image/resize,m_mfit,h_250,w_250 , error message is below: java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) call GlideException#logRootCauses(String) for more detail Cause (1 of 1): class java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000 Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, REMOTE, https://head.miyiapp.com/android/781015001706435046968.jpg?x-oss-process=image/resize,m_mfit,h_250,w_250 Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable} Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable} Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable} Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, REMOTE,

h-zhouwenjun avatar Feb 04 '24 09:02 h-zhouwenjun

https://file.wogoo.com/app/moments/20240625/1bdf4ba084c74cd3886228d324a14db9.png the file is incomplete I have same error when load this url ,but only one phone can load success

ytjojo avatar Jul 08 '24 10:07 ytjojo