Page MenuHomePhabricator

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

Description

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

ScreenshotUploadWizardBadToken.png (652×1 px, 81 KB)

Event Timeline

intracer raised the priority of this task from to Needs Triage.
intracer updated the task description. (Show Details)
intracer added a project: UploadWizard.
intracer subscribed.
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?

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)
matmarex set Security to None.
matmarex subscribed.

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 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).

@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. :)

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 subscribed.

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