Upload wizard fails with api-error-badtoken, cannot resubmit
Description
Details
Related Objects
- Mentioned In
- rEUWI72dbd8cd4eda: Really recover from 'badtoken' error when uploading
rMW408974afeb3f: Updated mediawiki/core Project: mediawiki/extensions/UploadWizard…
rEUWIed65064bea11: Really recover from 'badtoken' error when uploading
rMEXTa6dbce2f4701: Updated mediawiki/extensions Project: mediawiki/extensions/UploadWizard…
T112514: Interner Fehler: Der Token ist fehlerhaft. - Mentioned Here
- T102199: Reports of a high number of edits being rejected due to loss of session data
T71691: Ability to recover from an Expired session (badtoken)
Event Timeline
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
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.
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
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
Change 238325 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading
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.)
Change 238334 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading