UploadWizard does not handle 'duplicate-archive' errors correctly
Closed, ResolvedPublic

Description

The image content hash check for previously deleted files is not surfaced correctly through the UI.

Steps to reproduce:

Upload a file that's been previously deleted and proceed through the process

Expected behavior:

Failure on first (upload) step that file with the uploaded contents has been previously deleted.

Actual behavior:

Failure on final (publication) step: "Unknown warning: duplicate-archive"


Version: unspecified
Severity: normal

bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz30625.
Eloquence created this task.Via LegacyAug 29 2011, 11:27 PM
bzimport added a comment.Via ConduitNov 11 2011, 10:22 AM

andreengels wrote:

I got the same problem (with failure "An unknown error occurred.") when uploading a file that, as far as I could see, was not equal to the previously deleted one, but only had the same name.

MarkTraceur added a comment.Via ConduitMay 11 2012, 9:16 PM

The reason there is absolutely no indication of what the server would do is because, when UploadWizard passes in the parameter "ignorewarnings", apart from cleverly avoiding name-conflict errors, the API doesn't return any of the warning data.

This patch fixes it: https://gerrit.wikimedia.org/r/7312

Once that patch gets accepted and merged, I can throw together a patch to UW that will fix this bug fully. Expect it sometime in the near future.

MarkTraceur added a comment.Via ConduitMay 22 2012, 5:37 PM
  • Bug 36150 has been marked as a duplicate of this bug. ***
brion added a comment.Via ConduitMay 23 2012, 7:35 PM

We had to revert that version as it was a bit janky.

When there are warnings, the 'warnings' object is an object in JSON output, but when there are none it ends up becoming an array.

The additional check for empty warnings then got added to check for a 0 length attribute, which would be the wrong check on an object.

Warnings such as 'bad-prefix' for 'IMG_132483247.JPG' were getting reported, making it impossible to upload files directly from a camera since those warnings were seen as 'unknown-warning'.

MarkTraceur added a comment.Via ConduitMay 29 2012, 4:33 PM

There are three new patches for properly dealing with API warnings, one of them to mediawiki/core. This still doesn't fix the root of the issue for this bug (I believe), so again, we need to land these changes before we can seriously address the original issue.

MarkTraceur added a comment.Via ConduitMay 29 2012, 4:35 PM

Augh! There needs to be an edit button.

Second patch to UW: https://gerrit.wikimedia.org/r/8728

The second patch to UW should deal with _some_ of the problems associated with deleted files, but not all of them. duplicate-archive is, I think, still not dealt with properly, but more testing is needed.

MarkTraceur added a comment.Via ConduitMay 29 2012, 8:13 PM
  • Bug 37125 has been marked as a duplicate of this bug. ***
MarkTraceur added a comment.Via ConduitMay 29 2012, 8:18 PM
  • Bug 37126 has been marked as a duplicate of this bug. ***
MarkTraceur added a comment.Via ConduitJun 1 2012, 11:30 PM
  • Bug 30643 has been marked as a duplicate of this bug. ***
MarkTraceur added a comment.Via ConduitAug 16 2012, 4:09 PM

Hi,

Can someone on the CC list of this bug test again on Commons? One of the patches tied to this bug got merged, and I think the behavior may already be greatly improved. If it works, we can close the bug, if it doesn't, there is another patch sitting in Gerrit that could end this bug's reign of terror.

Thanks!

TheDJ added a comment.Via ConduitAug 25 2012, 8:49 AM

Created attachment 11004
still a problem

Still can't get past this problem.

Attached:

TheDJ added a comment.Via ConduitAug 25 2012, 10:42 AM

Wow, there is just a multitude of issues here it seems.

First there seems to be code in the initial upload step to check for duplicates. HOWEVER

1: I suspect the warning is actually encountered in setTransported(), and an error is set, but the logic probably overrides this with setSuccess afterwards. No feedback is ever provided and the upload seems just fine

You'll want something like:
if (warnings.duplicate) (or duplicate-archive)
var dupeFile = warnings.duplicate[0];

"This file is already available as [[File:dupeFile]]." vs. for archived "This file was previously available as [[File:setTransported]]". "Remove upload/Continue"

2: The archive error was not handled in the final step https://gerrit.wikimedia.org/r/21405

3: The duplicate errors should be ignored in the final step, just as was-deleted (which means you picked a title that previously has existed).

4: The .showError() of UploadDetails is simply non-recoverable. It does not allow you to remove the file that is problematic, and esp. for unknown errors, that is bad. I should allow you to remove the upload so you can continue the other uploads in your list.

5: The .showError() does not surface the 'Continue' and/or "Upload more files" buttons.

TheDJ added a comment.Via ConduitAug 25 2012, 1:44 PM

Did this duplicate stuff ever work ?

I doubt it. It seems it is trying to insert a function to create a dialog into the error msg.

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84726
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/86874

kaldari added a comment.Via ConduitAug 28 2012, 1:57 AM

I think this might be fixed now in the trunk version. Can someone verify?

Eloquence added a comment.Via ConduitAug 28 2012, 11:34 PM

Confirmed fixed in master, leaving bug open pending deployment and final verification.

(Small UX issue: The big "Retry uploads" button vs. file-specific override actions are a bit confusing. Maybe clean that up down the road.)

TheDJ added a comment.Via ConduitSep 13 2012, 9:45 PM

Deployed now as well, works for me.

Gilles added a project: Multimedia.Via WebDec 4 2014, 10:17 AM
Gilles raised the priority of this task from "High" to "Unbreak Now!".Via WebDec 4 2014, 10:21 AM
Gilles moved this task to Closed on the Multimedia workboard.
Gilles lowered the priority of this task from "Unbreak Now!" to "High".Via ConduitDec 4 2014, 11:22 AM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.