Page MenuHomePhabricator

Async non-chunked upload returns a result=Poll without a filekey
Closed, ResolvedPublic

Description

Test upload of one of the smallest webm I can create, 1 frame 1 second 120p, using $ ffmpeg -f rawvideo -video_size 160x120 -framerate 1 -i /dev/urandom -t 1 ~/test.webm, with ffmpeg version 3.0.2-2~bpo8+1 running on videodev.video.eqiad.wmflabs, also uploading on the same host to Commons:
{P4817}

Expected behavior: either the upload is treated like a non-async upload or a filekey is given so a checkstatus could be performed like an async upload.

I also tried to make sure this is not caused by TMH. An upload of a png created with $ < /dev/urandom rawtoppm -rgb 64 64 | pnmtopng > ~/test.png has the same results

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

1--===============0318849710748789415==
2Content-Type: text/plain
3MIME-Version: 1.0
4Content-disposition: form-data; name="comment"
5
6Test
7--===============0318849710748789415==
8Content-Type: text/plain
9MIME-Version: 1.0
10Content-disposition: form-data; name="maxlag"
11
125
13--===============0318849710748789415==
14Content-Type: text/plain
15MIME-Version: 1.0
16Content-disposition: form-data; name="format"
17
18json
19--===============0318849710748789415==
20Content-Type: text/plain
21MIME-Version: 1.0
22Content-disposition: form-data; name="text"
23
24Test
25--===============0318849710748789415==
26Content-Type: text/plain
27MIME-Version: 1.0
28Content-disposition: form-data; name="filename"
29
30Zhuyifei1999 test 2.webm
31--===============0318849710748789415==
32Content-Type: text/plain
33MIME-Version: 1.0
34Content-disposition: form-data; name="assert"
35
36user
37--===============0318849710748789415==
38Content-Type: text/plain
39MIME-Version: 1.0
40Content-disposition: form-data; name="token"
41
42REDACTED
43--===============0318849710748789415==
44Content-Type: text/plain
45MIME-Version: 1.0
46Content-disposition: form-data; name="action"
47
48upload
49--===============0318849710748789415==
50Content-Type: text/plain
51MIME-Version: 1.0
52Content-disposition: form-data; name="async"
53
54
55--===============0318849710748789415==
56Content-Type: video/webm
57MIME-Version: 1.0
58Content-disposition: form-data; name="file"; filename="FAKE-NAME"
59Content-Transfer-Encoding: binary
60
61[...]

"Upload from stash" and "Upload from POST" use the same code path via ApiUpload::performUpload(). It looks like when a31d0f8edd implemented "async upload from stash", it was overlooked that someone might attempt to do "async upload from POST" which isn't supported.

Technically it would be possible to implement this in the API, but it would make for increased code complexity in a module that already has a very complex execution flow. Since (as far as I know) no one has complained about this before, it should be acceptable to just have the client make separate requests for upload-to-stash and async-upload-from-stash.

Change 334384 had a related patch set uploaded (by Anomie):
ApiUpload: Raise an error on attempts to async-upload a POSTed file

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

Change 334384 merged by jenkins-bot:
ApiUpload: Raise an error on attempts to async-upload a POSTed file

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

Anomie claimed this task.