Page MenuHomePhabricator

VE startup crashes on [[mw:Manual:FAQ]], probably due to <languages /> tag
Closed, ResolvedPublic1 Story Points

Description

  1. Open VE on https://www.mediawiki.org/wiki/Manual:FAQ?veaction=edit
  2. JS error
Uncaught TypeError: Cannot read property 'extsrc' of null
    at VeCeMWAlienInlineExtensionNode.ve.ce.MWExtensionNode.generateContents (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:269:244)
    at VeCeMWAlienInlineExtensionNode.ve.ce.GeneratedContentNode.forceUpdate (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:477)
    at VeCeMWAlienInlineExtensionNode.ve.ce.GeneratedContentNode.update (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:477)
    at VeCeMWAlienInlineExtensionNode.VeCeGeneratedContentNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:475)
    at VeCeMWAlienInlineExtensionNode.VeCeMWExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:268:783)
    at VeCeMWAlienInlineExtensionNode.VeCeMWInlineExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:270:897)
    at new VeCeMWAlienInlineExtensionNode (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:328:283)
    at VeCeNodeFactory.oo.Factory.create (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:169:554)
    at VeCeParagraphNode.ve.ce.BranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:341)
    at VeCeParagraphNode.ve.ce.ContentBranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:346)
    at VeCeParagraphNode.VeCeBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:339)
    at VeCeParagraphNode.VeCeContentBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:345)
    at new VeCeParagraphNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:490)
    at VeCeNodeFactory.oo.Factory.create (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:169:554)
    at VeCeDocumentNode.ve.ce.BranchNode.onSplice (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:341)
    at VeCeDocumentNode.VeCeBranchNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:339)
    at new VeCeDocumentNode (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:486)
    at new VeCeDocument (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:329)
    at new VeCeSurface (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:378)
    at VeUiSurface.ve.ui.Surface.createView (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:526)
    at new VeUiSurface (load.php?debug=false&lang=en&modules=ext.visualEditor.core|oojs-ui-core%2Coojs-ui-widgets|oojs-ui.s…:523)
    at VeInitMwDesktopArticleTarget.ve.init.Target.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:147:31)
    at VeInitMwDesktopArticleTarget.ve.init.mw.Target.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:163:227)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.createSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:596:891)
    at VeInitMwDesktopArticleTarget.ve.init.Target.addSurface (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:147:696)
    at eval (eval at <anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin…:4), <anonymous>:164:651)

The problem seems to be because Parsoid outputs

<span typeof="mw:Extension/languages" about="#mwt258" data-mw="{&quot;name&quot;:&quot;languages&quot;,&quot;attrs&quot;:{},&quot;body&quot;:null}" id="mwAg">
</span>

for the wikitext <languages /> at the top of the page. It appears that .body being null in the JSON blob causes this crash, because the code in ve.ce.MWExtensionNode#generateContents expects mwData.body.extsrc to exist. So maybe this is a Parsoid bug, but at the same time VE should probably be more resilient against this kind of thing.

Event Timeline

Catrope created this task.Jun 1 2017, 2:33 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 1 2017, 2:33 AM
Mainframe98 updated the task description. (Show Details)Jun 1 2017, 10:54 AM
Esanders added a subscriber: Esanders.EditedJun 1 2017, 12:54 PM

It would be nice if the spec was clearer on this: https://www.mediawiki.org/wiki/Specs/HTML/1.3.0 (Pinging @ssastry)

Change 356581 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Guard against mwdata.body being null

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

Deskana assigned this task to Esanders.Jun 1 2017, 2:34 PM
Deskana triaged this task as Normal priority.
Deskana moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 356581 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Guard against mwdata.body being null

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

Jdforrester-WMF closed this task as Resolved.Jun 1 2017, 2:55 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 1 2017, 2:55 PM
Jdforrester-WMF set the point value for this task to 1.Jun 2 2017, 3:20 PM

It would be nice if the spec was clearer on this: https://www.mediawiki.org/wiki/Specs/HTML/1.3.0 (Pinging @ssastry)

For some reason, I didn't get an email on this ping. I should check my email settings. But, there may be a regression here plus we need to fix docs as well.

Parsoid's output has been broken since March 1st because of
https://gerrit.wikimedia.org/r/#/c/339689/2/lib/wt2html/tt/ExtensionHandler.js

However, I suppose this probably got triggered in VE because of other VE changes and / or this has been broken since then but only caught now because this only affects pages with the <languages /> tag which is a small subset of VE-edited pages.

Arlolra added a subscriber: Arlolra.Jun 7 2017, 8:10 PM

@ssastry Close, but I think it was broken by https://github.com/wikimedia/parsoid/commit/95ab1203078d26a459de1e09aedcebce0fdedf40#diff-762355f184acddda55e1e62a3562e13a instead. The one you linked is only when extensions aren't expanded.

This one went out on May 30th, which corresponds better to the timeline,
https://www.mediawiki.org/wiki/Parsoid/Deployments#Tuesday.2C_May_30.2C_2017_around_10:17_am_PT:_Y.C2.A0Deployed_d07dfe1a