Page MenuHomePhabricator

Complex categories make GWToolset fail on step 3 (batch preview)
Closed, ResolvedPublic

Description

Error message screen

Both on product and beta cluster, for the past 4 days GWT consistently fails with the message:
PHP fatal error in /srv/common-local/php-master/includes/OutputPage.php line 1294:
Call to a member function getText() on a non-object

See attachment for a screen capture.

The outage is only apparent when attempting to run the tool to upload a file, the forms in advance of that point work correctly showing the GWT user rights are valid. Test xml files have been tried with 4 and 1 image. The same file was uploaded through the GWT by Dan, with an immediately successful result, indicating that this is an issue tied to my account (User:Fæ). See http://commons.wikimedia.beta.wmflabs.org/wiki/File:Three_weeks_after_marriage-LCCN2003689153.tif for the uploaded file.


Version: unspecified
Severity: normal

Attached:

Picture_1.png (89×648 px, 16 KB)

Details

Reference
bz65620

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:13 AM
bzimport set Reference to bz65620.

Could you please provide the xml, etc. for us to try it directly?

The error you're pointing to seems related to categories.

Thanks. That xml worked fine on my local install.

the forms in advance of that point work correctly showing the GWT user rights are valid.

Are you getting the error on "Step 3: Batch preview", where the batch is normally previewed? Or on "Step 4: Batch upload" where the confirmation of the job creation is displayed?

Did you add any categories in the form on "Step 2: Metadata mapping"?

Ah ha - The error was generated on Batch preview and I did add categories.

I can get a successful preview by not choosing categories or only using the simple cat_1 = "British Cartoon Prints Collection" but the complex substitution one causes a fail "Images uploaded by {{subst:User:Fae/Fae}}"

The error appears to be down to use of a template this way within a category name.

As a known error, this is easy for me to now work around, but is probably a bug in the way categories get parsed compared to other fields.

At a minumum, this should be a normal error, not a fatal one.

This is possibly related to recent changes Dan has made to the Batch preview page: https://gerrit.wikimedia.org/r/#/c/127839/

Hey Dan - can you take a look at this, and at least comment on Gilles's hypothesis in comment 6?

(unassigning because it looks like Gergo isn't working on this)

hey mark - i’ll take a look at this on wednesday or sooner if i can.

  • narrowed down the issue to line 200 of includes/Forms/PreviewForm.php, $Output->setCategoryLinks( $item['categories'] ); it has a problem with the complex category; investigating further ...
  1. are categories such as [[Category:Images uploaded by {{subst:User:Fae/Fae}}]] allowed?

the issue for the preview page is definitely that complex category and the way i set-up the placement of the categories onto the preview page using $Output->setCategoryLinks( $item['categories'] ); that method doesn't seem to be able to handle the complex category. i tried to pre-parse the category ahead of time, but have not yet succeeded. at the moment i have 2 possible solutions:

  1. remove the display of the categories on the preview page.
  2. remove the complex category from the preview page, but allow non-complex categories on the preview page. the complex category would show on the final page.

unless someone else has time to sort out a better solution, which one shall we go with?

attempted to apply some logic that will pre-parse the category and if it fails will not display it in the preview, which would have resulted in an error.

https://gerrit.wikimedia.org/r/#/c/139410/

Change 139410 had a related patch set uploaded by Siebrand:
Complex categories

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

the patch has been deployed to production. are you okay with closing the ticket now?

spoke with Fæ at wikimania london. he said he’s fine with closing it.

Gilles triaged this task as Unbreak Now! priority.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:21 AM