Page MenuHomePhabricator

Upload wizard fails with api-error-badtoken, cannot resubmit
Closed, ResolvedPublic

Description

Upload wizard fails with api-error-badtoken, cannot resubmit

Event Timeline

intracer created this task.Sep 13 2015, 9:19 AM
intracer updated the task description. (Show Details)
intracer raised the priority of this task from to Needs Triage.
intracer added a project: UploadWizard.
intracer added a subscriber: intracer.
Restricted Application added a project: Multimedia. · View Herald TranscriptSep 13 2015, 9:19 AM
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald Transcript

Which size do these image files have?
Do you have the "Chunked uploads for files over 1MB in Upload Wizard" preference enabled on Commons in the Upload Wizard preferences?
Does anything appear in your browser's Developer/JavaScript console when trying again?

Restricted Application added a subscriber: Matanya. · View Herald TranscriptSep 13 2015, 3:09 PM

6 files about 2 Mb each
Settings:

	 Chunked uploads for files over 5 MB in Upload Wizard - unchecked
        Maximum number of concurrent uploads	- 0
matmarex updated the task description. (Show Details)Sep 13 2015, 6:05 PM
matmarex set Security to None.
matmarex claimed this task.
matmarex added a subscriber: matmarex.

I'm pretty sure I fixed this error once already, but I've seen the same thing the other day. I'll look into it soon.

MartinK reopened this task as Open.Sep 14 2015, 2:21 PM
MartinK triaged this task as Unbreak Now! priority.
matmarex lowered the priority of this task from Unbreak Now! to High.Sep 14 2015, 3:56 PM

I don't think this warrants "Unbreak Now!" priority. I believe this only affects users who open UploadWizard, leave the tab open for at least a few minutes while doing something else, and then come back to it. I'm going to debug this today, anyway.

@intracer, do you see the error again after refreshing the page and trying to upload files again? @Steinsplitter, since you filed the other bug in German – if you speak German, can you ask the reporter the same question as above? If yes, then this looks like a much weirder issue which would probably not be limited to UploadWizard (but also affect things like editing pages or setting preferences).

Jdforrester-WMF moved this task from Untriaged to Doing on the Multimedia board.Sep 14 2015, 4:40 PM

@matmarex We are in the middle of Wiki Loves Monuments right now. For multi uploads this probably is the most busy time of the year. Therefore it is really important to fix this issue as fast as possible!

Change 238325 had a related patch set uploaded (by Bartosz Dziewoński):
Really recover from 'badtoken' error when uploading

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

Thank you for filing this bug, I missed a spot when I was fixing this the last time (T71691). I hope I did not miss any this time. :)

And where are the tests?

Change 238334 had a related patch set uploaded (by MarkTraceur):
Really recover from 'badtoken' error when uploading

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

Change 238325 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading

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

I don't believe we have any tests that would cover this.

Unit tests for this would be unpleasant to write (you'd have to mock several API requests and responses) if UploadWizard didn't have as much global state as it does; right now I think they're all but impossible to write. We have unit tests for some areas, but only a few.

It's difficult to catch in browser tests (which are in a better state than unit tests) because, like I mentioned, running into this bug naturally requires leaving the browser tab/window idle for at least a few minutes, until your session expires. (I'm not sure how long sessions are set to last on Wikimedia wikis, but probably something like 30 minutes.)

Also, asking again, since it's not clear from the reports:

Do you experience this error immediately, and not after opening the tab and leaving it for a long time? That would mean T102199 has regressed and we need to reopen the investigation there. @intracer, @MartinK, is this what you see?

Change 238334 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading

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

Jdforrester-WMF closed this task as Resolved.Sep 14 2015, 11:25 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

This looks like it's now working, so marking as fixed. Please re-open if it recurs.

Jdforrester-WMF moved this task from Doing to Done on the Multimedia board.Sep 14 2015, 11:26 PM