Page MenuHomePhabricator

PDF thumbnails fail to render on newly-uploaded PDF files
Closed, ResolvedPublic

Description

PDF files uploaded to Commons, English Wikisource, and English Wikipedia (and presumably other projects) in the last day or so fail to display thumbnails. Tested in the latest versions of Firefox and Vivaldi.

For example, see [[File:Special 301 Report 2014.pdf]]

  • In the ProofreadPage extension, [[Index:Special 301 Report 2014.pdf]], the images of the pages are not displayed.
  • On the File page itself [[:File:Special 301 Report 2014.pdf]]) the pages are displayed as empty.
  • Additionally to viewing the file, if trying to see alternative resolutions (any from ''Other resolutions: 185 × 240 pixels | 371 × 480 pixels | 464 × 600 pixels | 593 × 768 pixels | 1,275 × 1,650 pixels.''), strange errors are displayed, for example:
Error generating thumbnail

Error creating thumbnail: Reading profile /etc/firejail/mediawiki-converters.profile Reading profile /etc/firejail/mediawiki-converters.profile �]0;firejail /usr/bin/convert -depth 8 -quality 95 -resize 185 - /tmp/transform_efeb80e7e64d.jpg �convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501. convert: no images defined `/tmp/transform_efeb80e7e64d.jpg' @ error/convert.c/ConvertImageCommand/3210. Parent pid 48742, child pid 48744 Parent is shutting down, bye...

Details

Related Gerrit Patches:
operations/mediawiki-config : masterRevert "Run Pdf Processors in firejails"

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 28 2017, 12:17 AM

Hi @beleg_tal, thanks for taking the time to report this!

PDF files uploaded to Commons, English Wikisource, and English Wikipedia (and presumably other projects) in the last day or so fail to display thumbnails.

All PDF files? Some pdf files? Can you provide full links (complete URLs) to some PDF files with that problem? Currently the task here only mentions https://en.wikisource.org/wiki/File:Special_301_Report_2014.pdf

beleg_tal added a comment.EditedApr 28 2017, 2:11 PM

PDF files uploaded to Commons, English Wikisource, and English Wikipedia (and presumably other projects) in the last day or so fail to display thumbnails.

All PDF files? Some pdf files? Can you provide full links (complete URLs) to some PDF files with that problem? Currently the task here only mentions https://en.wikisource.org/wiki/File:Special_301_Report_2014.pdf

As far as I can tell, the issue affects ALL PDF files uploaded in the last couple of days. We noticed it first on these two that are used in Wikisource projects:

I then went to https://commons.wikimedia.org/wiki/Special:NewFiles and searched the page for "PDF", and confirmed that the issue occurred on all PDF files in the first few thousand items listed. Currently the following PDF files are listed, and they are all affected:

Those are all the PDF files uploaded to Commons between 06:00 and the time of this post. I don't know how far back the issue goes. Older PDF files don't have this issue, e.g. https://commons.wikimedia.org/wiki/File:Eastern_Book_Company_%26_Ors_vs_D.B._Modak_%26_Anr.pdf which I uploaded on March 14.

Aklapper triaged this task as High priority.Apr 28 2017, 3:29 PM
Aklapper added a project: Regression.

Note: We've also identified the issue with https://commons.wikimedia.org/wiki/File:Improvisatrice.pdf whose latest revision was uploaded on March 22, which means that there are more files affected than only "the last few days".

Actually, looking at https://en.wikisource.org/wiki/File:Eastern_Book_Company_%26_Ors_vs_D.B._Modak_%26_Anr.pdf which I uploaded on March 14:

I assume that the issue is not tied to being proofread/not proofread, so much as being accessed in the first place.

This is most definitely broken due by https://phabricator.wikimedia.org/T164000, I can't really tell why that broke things, but reverting it is safe at this point; the underlying vulnerability in ghostscript is now fixed and the updated packages have been rolled out to the production cluster earlier the day.

Tgr added a subscriber: Tgr.Apr 28 2017, 9:28 PM
thumbnail failed on mw2150: error 0 "Reading profile /etc/firejail/mediawiki-converters.profile
Reading profile /etc/firejail/mediawiki-converters.profile
]0;firejail /usr/bin/convert -depth 8 -quality 95 -resize 180 - /tmp/transform_75a822c4e8a2.jpg convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: no images defined `/tmp/transform_75a822c4e8a2.jpg' @ error/convert.c/ConvertImageCommand/3210.
Parent pid 28613, child pid 28615

Parent is shutting down, bye..." from "('/usr/local/bin/mediawiki-firejail-ghostscript' '-sDEVICE=jpeg' '-sOutputFile=-' '-dFirstPage=2' '-dLastPage=2' '-dSAFER' '-r150' '-dBATCH' '-dNOPAUSE' '-q' '/tmp/localcopy_ee85b9c71615.pdf' | '/usr/local/bin/mediawiki-firejail-convert' '-depth' '8' '-quality' '95' '-resize' '180' '-' '/tmp/transform_75a822c4e8a2.jpg')"

The commands work for me locally (ghostcript 9.18, ImageMagick 6.8.9-9, with Special_301_Report_2014.pdf).
IIRC "no decode delegate" is a weird catchall bug in ImageMagick which usually has nothing to do with plugins not being available.

There is also some weird character encoding bug going on which is probably irrelevant.

The character encoding thing looks like its related to colours. Presumably the escape control character is being stripped by the logs

+1 to just reverting the pdfhandler config change

Change 350981 had a related patch set uploaded (by Reedy; owner: Reedy):
[operations/mediawiki-config@master] Revert "Run Pdf Processors in firejails"

https://gerrit.wikimedia.org/r/350981

Reedy updated the task description. (Show Details)Apr 29 2017, 9:48 AM

Change 350981 merged by jenkins-bot:
[operations/mediawiki-config@master] Revert "Run Pdf Processors in firejails"

https://gerrit.wikimedia.org/r/350981

Mentioned in SAL (#wikimedia-operations) [2017-04-29T09:59:23Z] <reedy@naos> Synchronized wmf-config/CommonSettings.php: Revert pdf processor firejails T164045 (duration: 02m 41s)

Reedy closed this task as Resolved.Apr 29 2017, 10:00 AM
Reedy claimed this task.
Reedy added a subscriber: Reedy.

Tested a few of the listed PDFs above, seem to be thumbnailing now after a revert of the offending change

Please feel free to reopen if it seems to be widely broken. Though, please purge the PDF file page first to cause a thumbnail refresh in the first instance if it's showing broken