Last modified: 2013-04-22 16:15:41 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 T46909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44909 - Chunked upload 500 Internal Server Error for Commons API
Chunked upload 500 Internal Server Error for Commons API
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-12 17:18 UTC by Smallman
Modified: 2013-04-22 16:15 UTC (History)
5 users (show)

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


Attachments
The chunked upload request. (1.01 MB, text/plain)
2013-02-12 17:18 UTC, Smallman
Details
Response (437 bytes, text/plain)
2013-02-12 17:18 UTC, Smallman
Details
File in request (2.85 MB, image/png)
2013-02-12 17:19 UTC, Smallman
Details

Description Smallman 2013-02-12 17:18:13 UTC
Created attachment 11769 [details]
The chunked upload request.

I'm getting a '500 Internal Server Error' error when attempting to do a chunked upload via the commons API. 

I've attached the request/response with cookie/token removed. (I also spoof the IE browser for testing).

What would a proper raw chunked upload request look like?
Comment 1 Smallman 2013-02-12 17:18:52 UTC
Created attachment 11770 [details]
Response
Comment 2 Smallman 2013-02-12 17:19:22 UTC
Created attachment 11771 [details]
File in request
Comment 3 Andre Klapper 2013-02-12 17:37:40 UTC
File size = 2,985,402 bytes
Comment 4 Smallman 2013-02-12 17:44:27 UTC
I fixed it by including filename for the chunk param even though it's not used:

------------------------------90583427db83
Content-Disposition: form-data; name="chunk"; filename="something"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

It should give some sort of error as opposed to a 500.
Comment 5 Brad Jorsch 2013-02-13 00:22:37 UTC
Without the filename in the chunk parameter, PHP doesn't recognize it as a file upload field. So it tries to process this long chunk of data as if it were a text field, and runs out of memory while trying to run Unicode normalization over it.

But yeah, it would also be nice if the API would recognize that the file upload field is not actually being recognized as a file upload and give an error message rather than even trying to fetch it as a text field.
Comment 6 Brad Jorsch 2013-02-26 21:58:31 UTC
Gerrit change #51041
Comment 7 Brad Jorsch 2013-03-19 17:37:24 UTC
Change merged

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


Navigation
Links