Last modified: 2014-08-18 21:37:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66554, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64554 - MultimediaViewer fails with “Impossible to load thumbnail data, could not load image from etc.”
MultimediaViewer fails with “Impossible to load thumbnail data, could not loa...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
MultimediaViewer (Other open bugs)
master
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
https://i.imgur.com/xWc7BCO.png
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-28 15:41 UTC by Jean-Fred
Modified: 2014-08-18 21:37 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
aklapper: Backport_to_Stable+


Attachments
MultimediaViewer “Impossible de charger les données de la vignette” error message (140.51 KB, image/jpeg)
2014-04-28 15:41 UTC, Jean-Fred
Details

Description Jean-Fred 2014-04-28 15:41:27 UTC
Created attachment 15230 [details]
MultimediaViewer “Impossible de charger les données de la vignette” error message

Reported on fr.wikipedia.

On this example, a PNG map, MultimediaViewer randomly fails to display the image. A red message is displayed centered:

« Erreur : Impossible de charger les données de la vignette. could not load image from https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Carte_Projet_Illustration_des_communes_fran%C3%A7aises_10_03_2014.png/1280px-Carte_Projet_Illustration_des_communes_fran%C3%A7aises_10_03_2014.png »

along with a red cross in the middle.

The bottom metadata panel is not displayed either.

Here is the failing file:
https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:RAW/2014-04-25#mediaviewer/Fichier:Carte_Projet_Illustration_des_communes_fran%C3%A7aises_10_03_2014.png

I could not reproduce the bug ; the user mentionned it happens randomly to them. See attachment for the result.
Comment 1 Tisza Gergő 2014-04-28 20:21:57 UTC
This is expected behavior when there are network or backend errors. The interface is ugly, we didn't have time to make a proper error page yet (that would be https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/299 ). Apparently the server is returning a HTTP 500 when we request a thumbnail ("Error creating thumbnail: Error code: 137"); maybe the image is too big.

We should still show the metadata panel; that's a bug, but probably already fixed by https://gerrit.wikimedia.org/r/127384 (goes live this Thursday).
Comment 2 T. Gries 2014-06-12 23:47:13 UTC
<img src="https://i.imgur.com/xWc7BCO.png"> Example for output in case of failure.

I recently discovered E:MultimediaViewer and installed it on all of my wikis - different OS, different VMs. All wikis show in about 25% of all images this problem, and I wonder, why you installed on Wikipedia this extension with such a bug (or potential bug).

Server logs show "file not found" in such cases.

Ctrl+F5 in the browser helps - the 1280(or other) pixel image is then rendered.

Let me know, if you need more details.
Comment 3 T. Gries 2014-06-12 23:48:20 UTC
This bug is very annoying, pls. can you fix this with a high priority ?
Comment 4 Mark Holmquist 2014-06-12 23:49:14 UTC
This happens when thumbnails aren't ready...I think the reason it doesn't break in production is that thumb.php is our 404 handler for thumbnails.
Comment 6 T. Gries 2014-06-12 23:50:42 UTC
(In reply to Mark Holmquist from comment #4)
> This happens when thumbnails aren't ready...I think the reason it doesn't
> break in production is that thumb.php is our 404 handler for thumbnails.

Ah, a good point! Can you perhaps publish (here) the code for such a workaround?
Comment 7 T. Gries 2014-06-12 23:50:57 UTC
"mid-air collision". thx
Comment 8 T. Gries 2014-06-12 23:51:39 UTC
Should be documented in E:MultimediaViewer Installation (wiki and repo)
Comment 9 T. Gries 2014-06-12 23:52:47 UTC
@Mark: I will try to test this as soon as possible and report my results (later) here.
Comment 10 Tisza Gergő 2014-06-12 23:59:16 UTC
The image should be generated by the imageinfo API request AFAIK. Might try to set $wgMediaViewerUseThumbnailGuessing = false although in theory that should still work without a 404 handler, just less efficiently.
Comment 11 T. Gries 2014-06-13 00:45:22 UTC
(In reply to Tisza Gergő from comment #10)
> The image should be generated by the imageinfo API request AFAIK. Might try
> to set $wgMediaViewerUseThumbnailGuessing = false although in theory that
> should still work without a 404 handler, just less efficiently.

+1

Confirmed! 

Your tip saved my live: setting this to false solved definitely all these problems on my servers. 

Perhaps, the extension developers should set the default value as indicated by you to:

 $wgMediaViewerUseThumbnailGuessing = false;

@Jean-Fred: you originally reported this bug. Please can you try the setting and then report here (and close the issue, if solved)?
Comment 12 T. Gries 2014-06-13 00:47:47 UTC
@Tisza, @Mark:
was my test and reply quick enough? ;-)
Comment 13 Tisza Gergő 2014-06-13 19:28:15 UTC
Do you have a public wiki where I could test this? I would still like to see how thumbnail guessing fails; it tries to load the image without making an API request (which will fail with certain wiki configurations, including the default one IIRC), but should fall back on the API request if it receives a 404, and that apparently did not work for your site.
Comment 14 T. Gries 2014-06-13 20:58:32 UTC
(In reply to Tisza Gergő from comment #13)
> Do you have a public wiki where I could test this? 

Currently: I don't have any public wiki ready with the extension, but I can set up a my testwikis which run as wmflab instances. However, I am extremely short of time - will see what I can do in the next hours, or days.

I can say, the whole day, I had not a single failure on my big enterprise wikis any more, which is great news. In my view, you should simply set the default value to false.
Comment 15 Tisza Gergő 2014-06-13 21:02:39 UTC
(In reply to T. Gries from comment #14)
> I can say, the whole day, I had not a single failure on my big enterprise
> wikis any more, which is great news. In my view, you should simply set the
> default value to false.

I will do that; still, if things don't work with it set to true, that means there is a bug in the code, or there is some possible condition that I did not take into account, and it would be nice to get to the bottom of that.
Comment 16 Laurence 'GreenReaper' Parry 2014-06-25 15:13:33 UTC
I can confirm, the default $wgMediaViewerUseThumbnailGuessing = true doesn't always work right if you don't have a 404 handler set up. Here's why: large sites probably *do* have caching set up (e.g. CloudFlare or Varnish), and the 404 will be cached, so the request after generation gets the cached 404. Whoops. This hurts everyone else who tries to access the cached file while the 404 is cached.

You could try adding no-cache headers to your second request; or if that is not possible, add a query parameter to the URL based on, say, the timestamp to break the cache for your backup request.
Comment 17 Laurence 'GreenReaper' Parry 2014-06-25 15:21:55 UTC
Also, Firefox is showing your two requests for the same image coming immediately in succession, with the call to imageinfo coming *after* both requests. In this situation, it will never work on the first view, even if caching is not an issue or you use cache-busting techniques. It needs to render the thumb first.
Comment 18 Tisza Gergő 2014-06-26 22:43:27 UTC
(In reply to Laurence 'GreenReaper' Parry from comment #16)
> I can confirm, the default $wgMediaViewerUseThumbnailGuessing = true doesn't
> always work right if you don't have a 404 handler set up. Here's why: large
> sites probably *do* have caching set up (e.g. CloudFlare or Varnish), and
> the 404 will be cached, so the request after generation gets the cached 404.
> Whoops. This hurts everyone else who tries to access the cached file while
> the 404 is cached.

Indeed, we ran into the same issue on Labs Beta recently (bug 67056).

> You could try adding no-cache headers to your second request; or if that is
> not possible, add a query parameter to the URL based on, say, the timestamp
> to break the cache for your backup request.

Adding no-cache would defeat the point of thumbnail guessing, which is to shave off a few hundred milliseconds from the image loading time. (Plus, it would split frontend caches and increase their disk space usage significantly.) It's better to disable it by default then.

(In reply to Laurence 'GreenReaper' Parry from comment #17)
> Also, Firefox is showing your two requests for the same image coming
> immediately in succession, with the call to imageinfo coming *after* both
> requests. In this situation, it will never work on the first view, even if
> caching is not an issue or you use cache-busting techniques. It needs to
> render the thumb first.

That's... complicated. We send an AJAX request for the image first, to get progress events and cache hit stats, fall back to a normal resource request if that doesn't work (due to crossorigin limitations, typically), fall back to imageinfo if even that doesn't work and send another request after the API call has finished.

There should probably be a flag to disable AJAX loading; it can be a problem with some setups, as in bug 62469
Comment 19 Morbus Iff 2014-06-27 01:14:51 UTC
Random reporter from IRC. $wgMediaViewerUseThumbnailGuessing = false; works pretty well for me. In my case, I have no thumbs 404 handler (and, when the thumbnail didn't exist on the server, an .htaccess Rewrite rule would send the request back to Main_Page, confusing E:MultimediaViewer). After false'ing, my large images (>3 megs and over), which were causing the hiccups, are now all loading properly.
Comment 20 Laurence 'GreenReaper' Parry 2014-06-27 01:29:48 UTC
> Adding no-cache would defeat the point of thumbnail guessing, which is
> to shave off a few hundred milliseconds from the image loading time.

I think you missed the point - your second request *may get a 404* if you simply repeat it, even if the image _has_ been generated on the server by that point, because intermediate servers may cache the 404 for a short period of time.

The cache-busting on the second request for the thumbnail is intended to avoid this situation. Otherwise you get a big red message.
Comment 21 Gerrit Notification Bot 2014-06-27 01:37:53 UTC
Change 142475 had a related patch set uploaded by Gergő Tisza:
Disable thumbnail URL guessing by default

https://gerrit.wikimedia.org/r/142475
Comment 22 Gerrit Notification Bot 2014-06-27 01:45:02 UTC
Change 142476 had a related patch set uploaded by Gergő Tisza:
Keep thumbnail guessing enabled

https://gerrit.wikimedia.org/r/142476
Comment 23 Tisza Gergő 2014-06-27 01:55:31 UTC
(In reply to Laurence 'GreenReaper' Parry from comment #20)
> I think you missed the point - your second request *may get a 404* if you
> simply repeat it, even if the image _has_ been generated on the server by
> that point, because intermediate servers may cache the 404 for a short
> period of time.

There is no point in adding a workaround to thumbnail guessing which makes it slower than not using it in the first place - the whole point of the feature is to improve speed. For sites which have a CDN or reverse proxy, sending lots of requests which go around it will probably cause problems and/or be much slower. You should just not use thumbnail guessing in that case. (And if you care about speed, you should set up 404-handler-based thumbnail generation anyway.)
Comment 24 Laurence 'GreenReaper' Parry 2014-06-27 02:27:18 UTC
I think we've been misunderstanding each other, but it's my fault. :-)

What I was trying to say was that even when I set this variable to "false", there was an issue loading the image; it'd attempt to load twice in quick succession, failing both times, and only then make API calls. My belief was that this was the intended behaviour, and I was trying to suggest how it might be improved.

Having retested this, it seems that likely that I had cached resources which caused it to go down the "true" path even though I'd set it to "false". When I tried it again, having cleared everything out, it generated the image as expected.
Comment 25 Tisza Gergő 2014-06-27 05:54:49 UTC
Thanks for clearing that up!

Yeah, site-wide settings are passed via ResourceLoader which generates static .js files from them. I don't know the details of the caching strategy, but on WMF sites it's typically 5-10 minutes until a change takes effect.
Comment 26 Gerrit Notification Bot 2014-06-30 23:01:04 UTC
Change 142476 merged by jenkins-bot:
Keep thumbnail guessing enabled

https://gerrit.wikimedia.org/r/142476
Comment 27 Andre Klapper 2014-08-17 11:12:08 UTC
https://gerrit.wikimedia.org/r/#/c/142475/ still left here.
Comment 28 Gerrit Notification Bot 2014-08-18 17:41:35 UTC
Change 142475 merged by jenkins-bot:
Disable thumbnail URL guessing by default

https://gerrit.wikimedia.org/r/142475
Comment 29 Gerrit Notification Bot 2014-08-18 19:23:45 UTC
Change 154876 had a related patch set uploaded by Gergő Tisza:
Disable thumbnail URL guessing by default

https://gerrit.wikimedia.org/r/154876
Comment 30 Gerrit Notification Bot 2014-08-18 20:54:48 UTC
Change 154876 merged by Gergő Tisza:
Disable thumbnail URL guessing by default

https://gerrit.wikimedia.org/r/154876
Comment 31 Tisza Gergő 2014-08-18 20:58:13 UTC
Merged and backported to 1.23. I think this takes care of all cases when this error appears, apart from genuine network errors, and maybe private wikis, but there is another ticket for that (bug 68522).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links