Page MenuHomePhabricator

Failed 97MB PDF chunked upload to Commons: "No specifications provided to ArchivedFile constructor."
Closed, DuplicatePublic

Description

Third failed attempt to upload this file https://commons.wikimedia.org/wiki/File:Guillot_de_Paris_-_Le_Dit_des_rues_de_Paris.pdf from http://bibliotheque-numerique.inha.fr/collection/5981-le-dit-des-rues-de-paris/ with the message "00994: FAILED: success" (sic).
This is a big file (97.2 MB).

Event Timeline

Yann created this task.Aug 2 2015, 5:45 PM
Yann raised the priority of this task from to Normal.
Yann updated the task description. (Show Details)
Yann added a project: Commons.
Yann added a subscriber: Yann.
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald TranscriptAug 2 2015, 5:45 PM
Rillke added a subscriber: Rillke.Aug 2 2015, 7:45 PM

About 30 min after you get such a stupid error message, go to https://commons.wikimedia.org/w/index.php?title=Special:UploadStash&withJS=MediaWiki:EnhancedStash.js and try publishing from there.

It appears there is an issue with uploading djvu and pdf files: T94562

Aklapper renamed this task from Failed upload via Chunked Upload to Failed 97MB PDF upload to Commons via Chunked Upload: "00994: FAILED: success".Aug 3 2015, 8:41 AM
Aklapper added a project: MediaWiki-Uploading.
Aklapper set Security to None.
Restricted Application added a project: Multimedia. · View Herald TranscriptAug 3 2015, 8:41 AM

(Please associate MediaWiki-Uploading to such tasks when triaging. Thanks.)

Restricted Application added a subscriber: Matanya. · View Herald TranscriptAug 3 2015, 8:41 AM
Yann added a comment.Aug 3 2015, 3:10 PM

Hi, Thanks for your answer. How long does it stay in the Stash?

Yann added a comment.Aug 3 2015, 3:11 PM

Currently I see that there:

13cfuy62ygts.xgyw0d.1.pdf
2015-08-02 17:26:48
97 MiB 111 × 951px

Yann added a comment.Aug 3 2015, 3:29 PM

That's the message I get:

zhuyifei1999 moved this task from Incoming to Uploading on the Commons board.Aug 9 2015, 8:17 AM
zhuyifei1999 added a subscriber: zhuyifei1999.

That's the message I get:

@Yann: Please paste error messages as text so they can be found when searching for text in Phabricator. Thanks in advance!

3BRBS added a subscriber: 3BRBS.Aug 31 2015, 11:50 PM

Hi,

I believe the error should be similar to this:

Since I couldn't publish from that screen, and this is what I got:

Uncaught Error: Empty or wrong API response.
title=MediaWiki:EnhancedStash.js&action=raw&ctype=text/javascript:438
{"servedby":"mw1201","error":
{"code":"internal_api_error_MWException","info":"[b7e99e43] Exception Caught: No specifications provided to ArchivedFile constructor."}}

or

Error: Empty or wrong API response. {"servedby":"mw1204","error":{"code":"internal_api_error_MWException","info":"[97b50521] Exception Caught: No specifications provided to ArchivedFile constructor."}}

3BRBS

Aklapper renamed this task from Failed 97MB PDF upload to Commons via Chunked Upload: "00994: FAILED: success" to Failed 97MB PDF chunked upload to Commons: "No specifications provided to ArchivedFile constructor.".Sep 1 2015, 11:07 AM
Tgr added subscribers: Anomie, Tgr.Sep 1 2015, 9:44 PM

The error details here are

2015-08-31 23:19:16 mw1201 commonswiki exception ERROR: [b7e99e43] /w/api.php   MWException from line 145 of /srv/mediawiki/php-1.26wmf20/includes/filerepo/file/ArchivedFile.php: No specifications provided to ArchivedFile constructor. {"exception":"[Exception MWException] (/srv/mediawiki/php-1.26wmf20/includes/filerepo/file/ArchivedFile.php:145) No specifications provided to ArchivedFile constructor.
[stacktrace]
#0 /srv/mediawiki/php-1.26wmf20/includes/upload/UploadBase.php(664): ArchivedFile->__construct(NULL, integer, string, NULL)
#1 /srv/mediawiki/php-1.26wmf20/includes/api/ApiUpload.php(564): UploadBase->checkWarnings()
#2 /srv/mediawiki/php-1.26wmf20/includes/api/ApiUpload.php(129): ApiUpload->getApiWarnings()
#3 /srv/mediawiki/php-1.26wmf20/includes/api/ApiUpload.php(110): ApiUpload->getContextResult()
#4 /srv/mediawiki/php-1.26wmf20/includes/api/ApiMain.php(1093): ApiUpload->execute()
#5 /srv/mediawiki/php-1.26wmf20/includes/api/ApiMain.php(432): ApiMain->executeAction()
#6 /srv/mediawiki/php-1.26wmf20/includes/api/ApiMain.php(405): ApiMain->executeActionWithErrorHandling()
#7 /srv/mediawiki/php-1.26wmf20/api.php(88): ApiMain->execute()
#8 /srv/mediawiki/w/api.php(3): include(string)
#9 {main}
"}

It only happens with UploadFromStash, since that overrides getTempFileSha1Base36(). What's going on here seems to be:

  • The entire text of the PDF is being included in the "metadata" that UploadStash keeps.
  • The whole metadata collection gets serialized and stored into the us_props field in the database. But the us_props field is a BLOB, maximum length 65535 bytes. The serialized metadata with all that text can be larger than this, so MySQL silently truncates the value.
  • When UploadStash tries to read the metadata back in, the unserialize fails.
  • And then when UploadFromStash tries to get the sha1 out of the metadata, it gets null back.
In T94562#1594127, @Tgr wrote:

Workaround is to use Special:Upload which does not use the upload stash. The short-term fix would be to increase the field size. In the long term, we probably want to rethink what to store in the metadata hash (see also T32906).