Page MenuHomePhabricator

Show meaningful error messages if import fails
Open, MediumPublic

Description

For each of the errors, show the error message described below

Errors that occur before special:import is loaded

errormw behaviorexample error messagecolorstatus
missing info (Error message in the first step)first version of thumbnail could not be retrieved anymore 30th Street at 5th Avenue - Straße in New York.jpgThe file cannot be imported, since it is missing <whatever it is missing>redOur error page with message "Can't import file because at least one of its revisions is missing an image file."
suppressed revisions (Error message in the first step)Doing LR work.jpgThe file cannot be imported, since the page contains suppressed revisions (Is this an info that is public?)redOur error page with message "Can't import file because at least one of its revisions contains a suppressed file."
sum of number of file and text revisions bigger than 100 revisions)MEDIAWIKI141227 Berliner Dom.jpg ( on the test server the revision limit is set to 25 )The file cannot be imported. The sum of file and page revisions is bigger than 100.redOur error page with message "Too many revisions returned by the API, can't import."
sum of size of file and text revisions bigger than 250 MB)MEDIAWIKIPiz Forbesch Panorama.png ( on the test server the aggregated file upload limit is set to 250MB )The file cannot be imported. The sum of all its revisions is bigger than 250 MB.redOur error page with message "Too many revisions returned by the API, can't import."
maximum filesize / uploadsize hit (as enforced by MediaWiki uploading)maximum filesize / uploadsize hit: there is not really a "standard" way for this error case. The individual upload forms check this individually, and show an ugly red line of text. we might want to reuse the existing largefileserver message, which says: "This file is bigger than the server is configured to allow." (Warning, this is only for a single file, not for a file with multiple versions!)Panorama Herrnhut Strahwalde Berthelsdorf.jpg ( on the test server the single file upload limit is set to 100MB )reuse existing largefileserver messageredOur error page with "The file you are currently trying to import exceeds the file size limit the import can handle."
file already existsA pretty extensive warning appears in the standard upload form.
Two messages could be reused: fileexists-duplicate-version: "The upload is an exact duplicate of {{PLURAL:$2 an older version older versions}} of <strong>[[:$1]]</strong>." file-exists-duplicate: "This file is a duplicate of the following {{PLURAL:$1 file files}}:"
just upload a file twicefileexists-duplicate-version: "The upload is an exact duplicate of {{PLURAL:$2 an older version older versions}} of <strong>[[:$1]]</strong>." --> link to duplicate is includedred
wiki not in wmf clusterThe file cannot be imported, since it is on <source wiki name>. Imports from that wiki are not allowed.red
revision history is somewhat broken?The file cannot be imported because there is a problem with the revision history.red
file format not acceptedexisting messages (filetype-badmime, filetype-mime-mismatch, and more
La chenille de la carotte (1911).webmUse existing messages + add: Allowed file types are <list of allowed file types>redSubticket: T193229
user is not logged inUserNotLoggedIn(this should actually never happen on WMF wikis due to global sign in)You are not logged in. Please log in before importing the file.even better: show login form immediatelyred
missing user rightsPermissionsError
, ReadOnlyError, ThrottledError, and UserBlockedError
e.g. User is not allowed to move files, the wiki is in maintenance mode, a user action hit a limit, or an IP got blocked for a short time.The file cannot be imported, because you don't have the rights to do so.red
wrong licenceThe file cannot be imported, because it is marked as <template name/ category name>. <The target wiki name> does not allow such files.redsub ticket: T194132
missing right licencee.g. for de-wiki, the config file requires cc-by-sa or something similarThe file cannot be imported, because it is not marked with one the required licences.redsubticket: T194502

Errors related to file title

May occur before special:import is loaded, or after trying to save a new name

title already existsIn the classic upload form this is shown as a yellow warning. The upload form shows up below the warning, so the user can resolve the issue by changing the target file name in the form (the file name of the source file is ignored then). I suggest we do the same.
The file title already exists on <target wiki>. Please choose a different one.red
title already exists in source wikirelated ticket: T193209The title you are currently trying to import to already exists on <source wiki>. Please choose a different one - otherwise the other file will be hiddenredThe title edit page with message "The title you are currently trying to import to already exists on the source wiki"
title contains forbidden characters (when this does not come from core)The classic upload form replaces all invalid characters (for both wgLegalTitleChars as well as wgIllegalFileChars) with dashes, shows a yellow warning explaining what happened, and shows the upload form again. The user can either change the name, or simply submit again. I suggest we do the same.
The title has been changed, because it contains forbidden characters. These characters are not allowed for file titles: < list of characters>yellow

Errors related to configfile parsing

errorexampleerror messagecolorstatus
Missing section or subsectionThere is no "Category" section, There is no "bad" in the "Category" sectionThe configuration file for your wiki (linking to the config file) does not contain enough info about <problem e.g. Category or Category/bad> to know if this file can be put on Commons.red  Part of T194129

Note All of these errors are tracked so that we see how often they appear (see T179564)

Event Timeline

Lea_WMDE triaged this task as Medium priority.Mar 13 2018, 10:26 AM
Lea_WMDE created this task.
Lea_WMDE set the point value for this task to 2.
Lea_WMDE updated the task description. (Show Details)

ErrorPageErrors

MediaWiki implements a series of errors that are meant to be displayed on friendly, white error pages, each containing a title and an extensive body (typically including links, lists and such). The most notable of these errors are:

PermissionsError

Will (in our case) happen if the user can't upload files, and can't use the FileImporter because of this.

In my opinion we should only replace this with something else if what we can come up with is more helpful for the user.

ReadOnlyError, ThrottledError, and UserBlockedError

These happen when the wiki is in maintenance mode, a user action hit a limit, or an IP got blocked for a short time. I believe we should stick to the default white error page in all these cases.

UserNotLoggedIn

Will be shown as a friendly, white error page with a link to the login form. Many special pages and extensions don't follow this pattern but show the login form instead. I believe we should do the same.

maximum filesize / uploadsize hit

I checked, and there is not really a "standard" way for this error case. The individual upload forms check this individually, and show an ugly red line of text. We can easily come up with our own style here. But we might want to reuse the existing largefileserver message, which says: "This file is bigger than the server is configured to allow." (Warning, this is only for a single file, not for a file with multiple versions!)

file already exists

A pretty extensive warning appears in the standard upload form. I think for the use case we have in mind we need to actively block the user from uploading a duplicate. If a duplicate really is what the user wants, he should not use FileImporter.


Two messages could be reused:

  • fileexists-duplicate-version: "The upload is an exact duplicate of {{PLURAL:$2|an older version|older versions}} of <strong>[[:$1]]</strong>."
  • file-exists-duplicate: "This file is a duplicate of the following {{PLURAL:$1|file|files}}:"

file format not accepted

Note the code checks both the MIME type and if the file extension matches. So it's not only the file extension. In both cases the classic upload form shows an ugly red "warning". I think it's safe to ignore this and not call it a "UX pattern". ;-) But we might want to reuse existing messages (filetype-badmime, filetype-mime-mismatch, and more).

user is not logged in

I believe the login form should be shown, and redirect back to the import page after login.

missing user rights

We can show a custom message, but we can also let MediaWiki do what it does anyway (see above).

title already exists

In the classic upload form this is shown as a yellow warning. The upload form shows up below the warning, so the user can resolve the issue by changing the target file name in the form (the file name of the source file is ignored then). I suggest we do the same.

title contains forbidden characters

The classic upload form replaces all invalid characters (for both wgLegalTitleChars as well as wgIllegalFileChars) with dashes, shows a yellow warning explaining what happened, and shows the upload form again. The user can either change the name, or simply submit again. I suggest we do the same.

There currently is also an error message if the file title already exists in the source wiki. This is not in the list. Is it supposed like this?

no this sound like a bug :) Could you file one, including the example, where that happened? Thanks, @MichaelSchoenitzer_WMDE !

Tobi_WMDE_SW added a subscriber: Tobi_WMDE_SW.

This became a tracking task, so removing the story point estimation. We will create distinct subtasks instead.

@JStrodt_WMDE / @Lena_WMDE: Hi! This task has been assigned for a long time. Is this still actively being worked on?

If this task has been resolved in the meantime: Please update the task status (via Add Action...Change Status in the dropdown menu).
If this task is not resolved and only if you do not plan to work on this task anymore: Please remove yourself as assignee (via Add Action...Assign / Claim in the dropdown menu): That would allow others to work on this (in theory), as others won't think that someone is already working on this.
Thanks a lot!

thiemowmde added a project: WMDE-TechWish.
thiemowmde added a subscriber: JStrodt_WMDE.

This is an old task, and most probably 99% done by now. Still I think it's worth checking and possibly creating smaller tickets for the remaining work.