Page MenuHomePhabricator

Upload file " bad-prefix" error appears and block upload
Closed, ResolvedPublic

Description

Hello,
When using the new Upload Wizard, the automatic step of checking "bad file names" occures.
This checking step was before at the step/tab "Describe", and is now at the step/tab "Upload".

I get the message « bad-prefix : IMG_5389.jpg » each time. (screenshot : https://i.snag.gy/IDBUpO.jpg )

IDBUpO.png (508×986 px, 110 KB)

Before, it was possible to change the name of the file in the text fields, now that this checking is in the first upload step, they're is no other possibility than cancel, change the file name on computer, and restart the upload.

This error obviously doesn't appears with the old upload form, and neither with a file already changed to "correctname.jpg".

I am using the french Upload Wizard (and I have another issue trying with english language selected).

Thanks !

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
matmarex reopened this task as Open.EditedJan 6 2017, 6:12 PM
matmarex added subscribers: jcrespo, matmarex.

I don't think this is the same issue. We've changed how various error messages are generated recently, this might be a regression.

I actually have no idea why this has started to happen now. It's caused by some change in MediaWiki core, not UploadWizard – I get the same error when testing current MediaWiki with an older UploadWizard version. But we should fix it in UW.

Change 330974 had a related patch set uploaded (by Bartosz Dziewoński):
Ignore 'bad-prefix' warning on the Upload step

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

matmarex triaged this task as Unbreak Now! priority.Jan 6 2017, 7:12 PM

Looking at UW's logs, this is affecting a huge number of uploads, causing as many UW upload failures as all legitimate errors counted together.

Change 330974 merged by jenkins-bot:
Ignore 'bad-prefix' warning on the Upload step

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

Change 330975 had a related patch set uploaded (by Bartosz Dziewoński):
Ignore 'bad-prefix' warning on the Upload step

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

Change 330975 merged by jenkins-bot:
Ignore 'bad-prefix' warning on the Upload step

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

I tracked down the root cause – this was actually caused by a change in UploadWizard: {8a6b6a49b3fe5e49bced9ed9ca847c18acfb0dce} (https://gerrit.wikimedia.org/r/#/c/327263/). Prior to that, we were prepending current timestamp to the file name before uploading, which was changed to work better with AbuseFilter. This prepended prefix meant that we never hit the real prefix checks, and the code to handle this warning was missing.