Page MenuHomePhabricator

{{#widget}} makes Parsoid worker die
Closed, ResolvedPublic

Description

The use of the #widget keyword (introduced by https://www.mediawiki.org/wiki/Extension:Widgets) makes Parsoid worker die.

Here for example with a git master (98387c2e8f3e5512045c0f762fca728795ebead0) and this wikicode:

{{#widget:foobar}}

I get

ApiRequest { method: 'POST',
  form: 
   { format: 'json',
     action: 'expandtemplates',
     prop: 'wikitext|categories',
     text: '{{#widget:foobar}}',
     title: 'Main_Page' },
  followRedirect: true,
  uri: 'http://devwiki.wikimedia.org.uk/w/api.php',
  timeout: 30000,
  proxy: undefined,
  strictSSL: true,
  headers: { 'User-Agent': 'Parsoid/0.1', Connection: 'close' } }
[fatal][devwiki/Main_Page?oldid=156] Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at peg$c379 (eval at <anonymous> (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:1356:61)
    at peg$parseeof (eval at <anonymous> (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:14738:12)
    at peg$parsetlb (eval at <anonymous> (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:2007:12)
    at peg$parsetoplevelblock (eval at <anonymous> (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:1909:12)
    at Object.parse (eval at <anonymous> (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:89:38), <anonymous>:17872:18)
    at PegTokenizer.tokenizeAsync (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:206:24)
    at PegTokenizer._processText (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:180:8)
    at PegTokenizer.process (/var/www/parsoid/lib/mediawiki.tokenizer.peg.js:119:7)
    at ParserPipeline.process (/var/www/parsoid/lib/mediawiki.parser.js:485:21)
    at Object.Util.processContentInPipeline (/var/www/parsoid/lib/mediawiki.Util.js:1112:12)
[warning][master][15113] worker 15465 died (1), restarting.

Version: unspecified
Severity: major

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:49 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz73526.
Arlolra subscribed.

Change 175930 had a related patch set uploaded (by Arlolra):
Fix crash on {{#widget}}s

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

Patch-For-Review

Change 175930 merged by jenkins-bot:
Fix crash while expanding templates on older wikis

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

It seemed to be template expansion in general on older version of mediawiki that was causing the crash. We had changed to the newer API (because of deprecation warnings) and didn't make it backwards compatible. Should be fixed on master. Thanks.

fbstj set Security to None.