Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote gif url load exception #2462

Closed
ccchp opened this issue Oct 10, 2017 · 9 comments
Closed

remote gif url load exception #2462

ccchp opened this issue Oct 10, 2017 · 9 comments
Labels
Milestone

Comments

@ccchp
Copy link

ccchp commented Oct 10, 2017

10-10 11:35:03.857 26060-27418/com.qunar.im E/GlideExecutor: Request threw uncaught throwable
                                                             java.lang.IllegalArgumentException: Fetchers don't match!, old: com.bumptech.glide.load.model.FileLoader$FileFetcher@5501613 new: com.bumptech.glide.load.model.FileLoader$FileFetcher@b90ae0a
                                                                 at com.bumptech.glide.util.Preconditions.checkArgument(Preconditions.java:17)
                                                                 at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:245)
                                                                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                 at java.lang.Thread.run(Thread.java:776)
                                                                 at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)

Load failed for https://qt.qunar.com/file/v2/download/perm/8d67e8b59808833e62cbcdd080b4fa36.gif?name=8d67e8b59808833e62cbcdd080b4fa36.gif with size [432x432]

RequestOptions requestOptions = new RequestOptions()
                    .error(R.drawable.atom_ui_sharemore_picture)
                    .placeholder(R.drawable.atom_ui_sharemore_picture)
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .dontAnimate();
            Glide.with(context)
                    .asGif()
                    .load(url)
                    .apply(requestOptions) 
                    .into(mLoadingImgView);
@sjudd
Copy link
Collaborator

sjudd commented Oct 10, 2017

What version of Glide are you using? Please always fill out the issue template.

Can you reproduce this in a sample app?

@ccchp
Copy link
Author

ccchp commented Oct 10, 2017

I use the latest version 4.2,I just delete requestOptions, only use
Glide.with(context) .asGif() .load(url) .into(mLoadingImgView);
then it's ok, I don't know why

@sjudd
Copy link
Collaborator

sjudd commented Oct 10, 2017

If you use the same RequestOptions, but change DiskCacheStrategy to things other than ALL, does it still reproduce?

@sjudd sjudd added the bug label Oct 10, 2017
@sjudd sjudd added this to the 4.3 milestone Oct 10, 2017
@sjudd
Copy link
Collaborator

sjudd commented Oct 11, 2017

I'm not able to reproduce this. If you're able to do so, can you attach a sample app? Or provide more detail?

@mattott
Copy link

mattott commented Oct 11, 2017

Glide Version: 4.2.0

Integration libraries: okhttp3

Device/Android Version: Samsung Galaxy S6 API 7.0; LG Nexus 5 API 4.4

Issue details / Repro steps / Use case background: We're simulating a screen share by polling a URL that will continuously update its source image.

Glide load line / GlideModule (if any) / list Adapter code (if any):

private void startPolling() {
    pollImageRunnable = new Runnable() {
        @Override
        public void run() {
            if (isAdded()) {
                    String imageUrl = "https://myurl.com/user_id=1234&cache_bust=" + System.currentTimeMillis();
                    final GlideRequest<Drawable> request = GlideApp.with(MyFragment.this)
                            .load(imageUrl)
                            .transform(rotateAndCenterTransformation)
                            .listener(requestListener);
                    if (!TextUtils.isEmpty(oldImageUrl)) {
                        request.thumbnail(Glide.with(MyFragment.this)
                                .load(oldImageUrl)
                                .apply(RequestOptions.bitmapTransform(rotateAndCenterTransformation)));
                    }
                    request.into(imageView);
                    oldImageUrl = imageUrl;
                }
            }
    };

    handler.postDelayed(pollImageRunnable, POLL_INTERVAL_MS);
}

private final RequestListener<Drawable> requestListener = new RequestListener<Drawable>() {
    private long timeSinceLastLoad = 0L;

    @Override
    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
        postAtInterval();
        return false;
    }

    @Override
    public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
        if (isFirstResource) {
            imageView.setImageDrawable(resource);
        }
        postAtInterval();
        return false;
    }

    private void postAtInterval() {
        long elapsedTime = System.currentTimeMillis() - timeSinceLastLoad;
        if (elapsedTime > POLL_INTERVAL_MS) {
            handler.post(pollImageRunnable);
        } else {
            handler.postDelayed(pollImageRunnable, POLL_INTERVAL_MS - elapsedTime);
        }
        timeSinceLastLoad = System.currentTimeMillis();
    }
};

Layout XML:

<ImageView
    android:id="@+id/sharedScreenImage"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

Stack trace / LogCat:

10-11 12:36:50.846 20173-17137/com.myapp E/GlideExecutor: Request threw uncaught throwable
    java.lang.IllegalArgumentException: Fetchers don't match!, old: com.bumptech.glide.load.model.FileLoader$FileFetcher@132a87f new: com.bumptech.glide.load.model.FileLoader$FileFetcher@9784b61
      at com.bumptech.glide.util.Preconditions.checkArgument(Preconditions.java:17)
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:245)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:762)
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$2.run(GlideExecutor.java:386)
10-11 12:36:50.861 20173-20173/com.myapp W/Glide: Load failed for https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247 with size [1440x2240]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, DATA_DISK_CACHE, https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
      Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
      Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
      Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
    Cause (2 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, DATA_DISK_CACHE, https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
      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://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
      Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
        Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
        Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
    Cause (4 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, REMOTE, https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
      Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
      Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
      Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
    Cause (5 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, REMOTE, https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
      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}
10-11 12:36:50.861 20173-20173/com.myapp W/Glide:  Cause (6 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, REMOTE, https://www.myurl.com/api/user_id=1234&cache_bust=1507750474247
    Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
      Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
    Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
      Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
10-11 12:36:50.864 20173-20173/com.myapp I/Glide: Root cause (1 of 4)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:133)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24)
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67)
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52)
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43)
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56)
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42)
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:260)
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:762)
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)
    Caused by: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at android.media.MediaMetadataRetriever.setDataSource(Native Method)
      at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:153)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:123)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52) 
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43) 
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56) 
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42) 
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:260) 
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
      at java.lang.Thread.run(Thread.java:762) 
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386) 
10-11 12:36:50.871 20173-20173/com.myapp I/Glide: Root cause (2 of 4)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:133)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24)
      at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:45)
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67)
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52)
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43)
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56)
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42)
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:260)
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:762)
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)
    Caused by: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at android.media.MediaMetadataRetriever.setDataSource(Native Method)
      at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:153)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:123)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24) 
      at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:45) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52) 
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43) 
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56) 
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42) 
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:260) 
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
      at java.lang.Thread.run(Thread.java:762) 
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386) 
10-11 12:36:50.872 20173-20173/com.myapp I/Glide: Root cause (3 of 4)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:133)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24)
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67)
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52)
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43)
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56)
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42)
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:263)
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:762)
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)
    Caused by: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at android.media.MediaMetadataRetriever.setDataSource(Native Method)
      at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:153)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:123)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52) 
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43) 
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56) 
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42) 
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:263) 
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
      at java.lang.Thread.run(Thread.java:762) 
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386) 
10-11 12:36:50.874 20173-20173/com.myapp I/Glide: Root cause (4 of 4)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:133)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24)
      at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:45)
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67)
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52)
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43)
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56)
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42)
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409)
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370)
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134)
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91)
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69)
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71)
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48)
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293)
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:263)
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
      at java.lang.Thread.run(Thread.java:762)
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)
    Caused by: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      at android.media.MediaMetadataRetriever.setDataSource(Native Method)
      at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:153)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:123)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:24) 
      at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:45) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:67) 
      at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:52) 
      at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:43) 
      at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:56) 
      at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:42) 
      at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:489) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:461) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:447) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:401) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.FileLoader$FileFetcher.loadData(FileLoader.java:74) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:409) 
      at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:370) 
      at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:134) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:91) 
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:69) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:48) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:293) 
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:263) 
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
      at java.lang.Thread.run(Thread.java:762) 
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386) 

@sjudd
Copy link
Collaborator

sjudd commented Oct 12, 2017

@mattott does this happen every time? Or sometimes?

@mattott
Copy link

mattott commented Oct 12, 2017

This happen more frequently when I use a BitmapTransformation and does not happen when I use Glide.with(Fragment.this).load(imageUrl).apply(RequestOptions.fitCenterTransform()).into(imageView):

public class RotateAndCenterTransformation extends BitmapTransformation {
    private static final String ID = RotateAndCenterTransformation.class.getName();
    private static final byte[] ID_BYTES = ID.getBytes(CHARSET);

    private final boolean isPortraitOnly;

    public RotateAndCenterTransformation(boolean isPortraitOnly) {
        this.isPortraitOnly = isPortraitOnly;
    }

    @Override
    protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
        int exifOrientation = isPortraitOnly ? ExifInterface.ORIENTATION_ROTATE_90 : ExifInterface.ORIENTATION_NORMAL;
        Bitmap rotatedImage = TransformationUtils.rotateImageExif(pool, toTransform, exifOrientation);
        return TransformationUtils.fitCenter(pool, rotatedImage, outWidth, outHeight);
    }

    @Override
    public boolean equals(Object o) {
        return o instanceof RotateAndCenterTransformation;
    }

    @Override
    public int hashCode() {
        return ID.hashCode();
    }

    @Override
    public void updateDiskCacheKey(MessageDigest messageDigest) {
        messageDigest.update(ID_BYTES);
    }
}

@sjudd
Copy link
Collaborator

sjudd commented Oct 13, 2017

I can reproduce this locally by comment out Glide's image decoders. This seems like it happens when all of Glide's decoders fail, both image and video. That implies that the image we're attempting to decode is invalid.

@mattott
Copy link

mattott commented Oct 13, 2017

Ah, okay. This also explains flicker that I'll sometimes see. I'm caching the imageUrl after I make the request and using it in the thumbnail for the subsequent request. I should probably be caching the imageUrl in RequestListener.onResourceReady.

@sjudd sjudd closed this as completed in 890454a Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants