Page MenuHomePhabricator

Bad error formatting after failed import
Closed, ResolvedPublic

Description

This has only been seen in local development, but is quite nasty. Import fails with no logging, and a malformed message is displayed:

image.png (465×1 px, 36 KB)

Event Timeline

I found the cause, it was a misconfiguration of my web server which prevented accessing images from the source wiki.

This can happen in the wild, if an image file is moved or permissions change we'll show this terribly unformatted and low-level error message.

Steps to reproduce:

  • Remove or chmod a-r the image file on the source wiki, under the images/ directory.
  • Export this file to the target wiki using the FileExporter button.
  • Submit the import.
awight renamed this task from Bad error formatting after failed import to Verify: Still have bad error formatting after failed import?.Jul 2 2020, 8:07 AM
awight set the point value for this task to 1.
awight changed the point value for this task from 1 to 2.Jul 3 2020, 8:39 AM

Confirmed, this is still a bug. The steps to reproduce above are correct. Additionally, when the AbuseFilter extension is enabled I get a fatal crash and stack trace, but this looks like a separate issue.

image.png (285×703 px, 21 KB)

I'll repurpose this task to do the fixing.

awight renamed this task from Verify: Still have bad error formatting after failed import? to Bad error formatting after failed import.Jul 3 2020, 8:41 AM

Change 793481 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Log and show reasons when commit operations fail

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

I just noticed that this here might be the same issue I described in T308753 and tried to fix in https://gerrit.wikimedia.org/r/793481. It's probably worth doing further tests with the proposed patch already applied.

WMDE-Fisch moved this task from Backlog to Doing on the WMDE-TechWish-Maintenance-2023 board.
WMDE-Fisch removed the point value for this task.

Change 969315 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/FileImporter@master] Show readable message from HttpRequestException errors

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

Change 969315 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Show readable message from HttpRequestException errors

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

Change 793481 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Log and show reasons when commit operations fail

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

Tobi_WMDE_SW claimed this task.