Page MenuHomePhabricator

In VE, while adding any image using Firefox getting the error "Image corrupt or truncated" in Betalabs
Closed, ResolvedPublic

Description

Screenshot

Steps to reproduce:

1.Open any page with VE in Betalabs using Firefox
2.Go to Insert>Media
3.Search for any image and select it to add it in the page

Observed Result:
The image gets added to the page but in the console there is an error:

Image corrupt or truncated: http://upload.wikimedia.org/wikipedia/commons/1/1b/Ko_BuWe.jpg


Version: unspecified
Severity: normal

Attached:

Screen_Shot_2014-10-15_at_6.08.15_PM.png (523×1 px, 294 KB)

Details

Reference
bz72115

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:58 AM
bzimport added a project: MediaViewer.
bzimport set Reference to bz72115.
bzimport added a subscriber: Unknown Object (MLST).

I don't see any such error in the Firefox 32 browser console when inserting the "Ko_BuWe" image in VisualEditor on http://en.wikipedia.beta.wmflabs.org.

Also, why is this under "MediaWiki General"?

Created attachment 16790
Console log in Iceweasel 32.0.3

I can't repro in Iceweasel 32.0.3. I've attached my console log with other warnings though :)

Done on http://en.wikipedia.beta.wmflabs.org/wiki/0.7358261884200304

Attached:

Selection_008.png (633×1 px, 117 KB)

Created attachment 16792
Screenshot

Hey Greg! I just added the following image in the same page you used, and got the error:

http://en.wikipedia.beta.wmflabs.org/wiki/0.7358261884200304#mediaviewer/File:Zwaardstootplaat-Rijksmuseum_AK-MAK-1056.jpeg

Attached:

Screen_Shot_2014-10-16_at_3.06.02_PM.png (585×1 px, 193 KB)

See also: http://stackoverflow.com/questions/11727219/image-corrupt-or-truncated-in-firefox

This probably isn't a Beta Cluster problem(?) so I'm moving to VE (feel free to move to where ever it really needs to be) on the assumption its a problem in the code (and I don't want it to not be addressed because it's 'hidden' in the Beta Cluster component).

I also can't reproduce this problem (MediaViewer issue?) in Chrome, Safari or Firefox? The error as state would be from the MW media fetching/thumbnailing API it sounds like?

From Gergo: https://bugzilla.mozilla.org/show_bug.cgi?id=646090

So, some image is corrupt (or just has had it's file extension changed, which is considered "corrupt"). Neither Mark H nor Gergo can repro. Rummana is the only person who can right now, right?

Rummana: can you repro with a clean Firefox profile?

The two images mentioned in the FF console in the screenshots:
https://commons.wikimedia.org/wiki/File:Ko_BuWe.jpg
https://commons.wikimedia.org/wiki/File:Zwaardstootplaat-Rijksmuseum_AK-MAK-1056.jpeg

The first file was loaded directly from Commons, the other from beta Commons.

I don't see why this would be a MediaViewer issue. (Was its appearence somehow correlated with using MediaViewer? MV can cause some oddities on Beta because it sometimes tries to preload thumbnails before they exist, and the resulting 404 gets cached - but this error is not related to that in any way I can see.) Some ideas:

  • some sort of local issue? Happens deterministically, but no one else could reproduce...
  • could be an actual image loading error: Firefox seems to emit this error if it fetches the content for an image file and it turns out not to be a valid image. Maybe the file gets truncated somehow (there were a lot of HTTP errors on beta after the HHVM switch, see e.g. bug 72162 - based on Rummana's screenshot, the file is not necessarily served by beta though, so such an error seems unlikely)
  • https://bugzilla.mozilla.org/show_bug.cgi?id=941823 mentions FF errors with large files - the ones mentioned in the bug are in the 100MP range though, while the two files in the screenshots are 10MP
  • there are claims that FF throws this error if you change the src of an image before it is fully loaded (e.g. http://stackoverflow.com/questions/11928878/detect-image-corrupt-or-truncated-in-firefox )

All in all, I would close this as worksforme if no one can reproduce and there are no reports of this happening in the wild.

Created attachment 16823
error message for inserted picture

Attached:

Screen_Shot_2014-10-20_at_11.06.46_AM.png (546×1 px, 295 KB)

I was able to reproduce the bug in FF 33. Look at the attached screenshot: Screen Shot 2014-10-20 at 11.06.46 AM

The issue was reproduced in test2.

(In reply to etonkovidova from comment #10)

The issue was reproduced in test2.

Which confirms this is not a "Beta Cluster stability" issue.

Can you look into the contents of the HTTP response (in the Firebug network tab, or a network analysis tool like Fiddler) and check if the content is damaged somehow?

As far I could see, there were no errors in header request/response. However,

there is one small thing(may be nothing):

Image corrupt or truncated: https://upload.wikimedia.org/wikipedia/commons/3/37/African_Bush_Elephant.jpg African_Bush_Elephant.jpg

<img class="ve-ce-focusableNode-highlight-relocatable-marker" src="data:image/gif;base64,R0lGODlh…EKAAEALAAAAAABAAEAAAICTAEAOw=="></img>

And the issue still is not reproducible 100% of the time.

After additional investigation with Roan.

Revised steps to reproduce:

  1. In test2 in FF - make sure that you just switched fro Read mode to Edit, or just refresh the browser window.
  1. Insert - Media, type 'artist'(without quotes) to display search results.
  1. In Console panel you'll see:

Image corrupt or truncated: https://upload.wikimedia.org/wikipedia/commons/d/db/Artist_drive.JPG

In Network panel you'll see that instead of a thumbnail img - 112x149 and https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Artist_drive.JPG/112px-Artist_drive.JPG,

the request was made for for 1536x2048 img and
GET https://upload.wikimedia.org/wikipedia/commons/d/db/Artist_drive.JPG

The Staus code: 206(not always).

Request/Response headers:

Request headers:
Host: upload.wikimedia.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://test2.wikipedia.org/w/index.php?title=ET_page&redirect=no&veaction=edit
Cookie: GeoIP=US:San_Francisco:37.7898:-122.3942:v4
Connection: keep-alive

Response headers:
Accept-Ranges:"bytes"
Access-Control-Allow-Origin:"*"
Access-Control-Expose-Headers:"Age, Date, Content-Length, X-Content-Duration, X-Cache, X-Varnish"
Age:"1652"
Connection:"keep-alive"
Content-Length:"2115604"
Content-Range:"bytes 32419-2148022/2148023"
Content-Type:"image/jpeg"
Date:"Thu, 23 Oct 2014 23:43:46 GMT"
Etag:"6eaae0b7e042739bd4a04e686eab8dea"
Last-Modified:"Mon, 07 Oct 2013 01:54:56 GMT"
Server:"nginx/1.1.19"
Via:"1.1 varnish, 1.1 varnish"
X-Cache:"cp1048 hit (2), cp1048 frontend miss (0)"
X-Object-Meta-Sha1base36:"8x65i07x23pfu6j7h8yl33asimaupwx"
X-Object-Meta-Sha1base36:"8x65i07x23pfu6j7h8yl33asimaupwx"
X-Timestamp:"1381110895.66655"
X-Trans-Id:"txc9084137ff28405983d9c-0054498c3f"
X-Varnish:"431922781 428031845, 3387585776"

If you attempt to insert again the same image - Request URL will be correct:
https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Artist_drive.JPG/112px-Artist_drive.JPG

Did we decide to declare this a "ghost in the machine" and move on?

(In reply to James Forrester from comment #15)

Did we decide to declare this a "ghost in the machine" and move on?

If Roan didn't notice the cause in the above debug, I'm not sure who ask to look deeper. It seems the wrong request is being made, right?

Rummana/Elena: Have either of you seen this issue recently?

Gilles subscribed.
Jdforrester-WMF claimed this task.

Deeming as resolved, then.