Page MenuHomePhabricator

Could not find data for image on pdf upload
Closed, ResolvedPublic

Description

Author: vpovilaitis

Description:
pdf

Could not find data for image 'Linkuvos_gimnazijos_laikkra\u0161t\u0117lis_Varpelis_79.pdf'.

Backtrace:

#0 /nas/enciklopedija/w/includes/filerepo/file/LocalFile.php(471): LocalFile->loadExtraFromDB()
#1 /nas/enciklopedija/w/includes/filerepo/file/LocalFile.php(666): LocalFile->load(1)
#2 /nas/enciklopedija/w/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php(110): LocalFile->getMetadata()
#3 [internal function]: CreatePdfThumbnailsJob::insertJobs(Object(UploadFromFile), 'application/pdf', true)
#4 /nas/enciklopedija/w/includes/Hooks.php(196): call_user_func_array('CreatePdfThumbn...', Array)
#5 /nas/enciklopedija/w/includes/GlobalFunctions.php(3872): Hooks::run('UploadVerifyFil...', Array)
#6 /nas/enciklopedija/w/includes/upload/UploadBase.php(475): wfRunHooks('UploadVerifyFil...', Array)
#7 /nas/enciklopedija/w/includes/upload/UploadBase.php(302): UploadBase->verifyFile()
#8 /nas/enciklopedija/w/includes/upload/UploadFromFile.php(97): UploadBase->verifyUpload()
#9 /nas/enciklopedija/w/includes/specials/SpecialUpload.php(406): UploadFromFile->verifyUpload()
#10 /nas/enciklopedija/w/includes/specials/SpecialUpload.php(172): SpecialUpload->processUpload()
#11 /nas/enciklopedija/w/includes/SpecialPage.php(628): SpecialUpload->execute(NULL)
#12 /nas/enciklopedija/w/includes/SpecialPageFactory.php(486): SpecialPage->run(NULL)
#13 /nas/enciklopedija/w/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#14 /nas/enciklopedija/w/includes/Wiki.php(565): MediaWiki->performRequest()
#15 /nas/enciklopedija/w/includes/Wiki.php(458): MediaWiki->main()
#16 /nas/enciklopedija/w/index.php(59): MediaWiki->run()
#17 {main}


Version: master
Severity: normal

Attached:

Details

Reference
bz48700

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:22 AM
bzimport set Reference to bz48700.
bzimport added a subscriber: Unknown Object (MLST).

Hi Vpovilaitis, which MediaWiki version is this about, and what are the exact steps to reproduce this problem?

vpovilaitis wrote:

MediaWiki version is 1.22alpha (abf3a8f). You can see at http://lietuvai.lt/wiki/Specialus:Versija

Problem was on upload pdf. I made several uploads, of diferent pdf files, including and pdf files witch was uploded with the older wersion of MediaWiki and PdfHandler.

I'm comment aut $IP/includes/filerepo/file/LocalFile.php 471 line ( /*$this->loadExtraFromDB();*/ ). After that this problem was solved. But I don't know may bee this my solution is not very good, but this temporary solve a problem.

Please recomend a better solution.

PDF was created with Microsoft 2010, metadata looks correct to me.

http://commons.wikimedia.beta.wmflabs.org/wiki/Special:UploadWizard says
"The upload succeeded, but the server could not get a preview thumbnail."

Same message in bug 48178 comment 8.

Doesn't seem to be happening in WMF production based on bawolff's quick investigation. Dropping priority to normal.

I think comment 4 is unrelated.

Some sort of race condition?

Issue happens if a file object is created, but when trying to load metadata from db, no image row.

matmarex changed the task status from Open to Stalled.Jul 20 2016, 3:23 PM
matmarex added a subscriber: matmarex.

PDF was created with Microsoft 2010, metadata looks correct to me.

http://commons.wikimedia.beta.wmflabs.org/wiki/Special:UploadWizard says
"The upload succeeded, but the server could not get a preview thumbnail."

I can no longer reproduce this on http://commons.wikimedia.beta.wmflabs.org/wiki/Special:UploadWizard or https://commons.wikimedia.org/wiki/Special:UploadWizard. The file thumbnail is shown correctly.

2016-07-20 17_22_36-Upload Wizard - Wikimedia Commons BETA - Opera.png (1×1 px, 155 KB)
2016-07-20 17_22_54-Kreator przesyłania plików – Wikimedia Commons - Opera.png (1×1 px, 160 KB)

Closing as this cannot be reproduced anymore nowadays. Please reopen if you can still reproduce.

Poikilotherm added a subscriber: Poikilotherm.

Dear all,

I can reproduce this with any kind of PDF on my private MediaWiki installation, no matter the size or content.

Edit: there also seem to be others with the same issue: https://www.mediawiki.org/wiki/Topic:Tmobfxre108n6rn5

Using:

MediaWiki1.27.4 (cc61b62)
PHP5.6.32 (fpm-fcgi)
MySQL5.6.37-log
ICU50.1.2
Lua5.1.5
CentOS7.4 latest patches

Extensions:

PDF Handler(847b64e) branch REL1_27
plus some more...

I am using a cronjob for the background job queue.

Relevant config options:

$wgEnableUploads = true;
$wgImgAuthPublicTest = false;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = '/usr/bin/convert';
$wgJobRunRate = 0;
require "$IP/extensions/PdfHandler/PdfHandler.php";
$wgPdfCreateThumbnailsInJobQueue = false;

If I set $wgPdfCreateThumbnailsInJobQueue = true;, uploads of PDFs fails with the exception described by the task opener. Set to false, things start moving again.

I'm willing to help tackle this down. Also willing to create a clone of my installation without content. Any help is appreciated.

Thanks in advance!

Cheers
Oliver

Hi,
I am having the same issue and I described it here. I tried everything related with folders permissions but nothing seems to work; and the issue is not related with SELinux or AppArmor as well, since I disabled them and the problem still occurs.

In my case did not even work setting $wgPdfCreateThumbnailsInJobQueue = false;.

Thanks for your help!
Cheers,
Lorenzo

UPDATE
After disabling PdfHandler, I succeeded to upload pdfs; enabling it again and all the thumbnails are correctly generated, so the issue is just during the upload process.

jijiki claimed this task.
Raphoraph added a subscriber: Raphoraph.

This task has been closed but with no explanation, and no proof that the bug was removed. The last comment explains that it succeeds when the extension is disabled...
This bug is almost certainly linked to T284416. It is still happening in 1.35 when the mentionned setting is enabled.

This task was closed four years ago. If there are any problems nowadays, please file a new ticket instead. Thanks.