Page MenuHomePhabricator

TypeError: Argument 1 passed to Wikimedia\Parsoid\Utils\DOMCompat::nodeName() must implement interface Wikimedia\Parsoid\DOM\Node, null given, called in /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/P
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to Wikimedia\Parsoid\Utils\DOMCompat::nodeName() must implement interface Wikimedia\Parsoid\DOM\Node, null given, called in /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/P
exception.trace
from /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Utils/DOMCompat.php(67)
#0 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(147): Wikimedia\Parsoid\Utils\DOMCompat::nodeName(NULL)
#1 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(256): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeListEltWidth(NULL)
#2 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(505): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeTagWidths(NULL, NULL, Wikimedia\Parsoid\DOM\Element, Wikimedia\Parsoid\NodeData\DataParsoid)
#3 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(567): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeNodeDSR(Wikimedia\Parsoid\Wt2Html\Frame, Wikimedia\Parsoid\DOM\Element, NULL, NULL, integer, array)
#4 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(567): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeNodeDSR(Wikimedia\Parsoid\Wt2Html\Frame, Wikimedia\Parsoid\DOM\Element, NULL, NULL, integer, array)
#5 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(731): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeNodeDSR(Wikimedia\Parsoid\Wt2Html\Frame, Wikimedia\Parsoid\DOM\DocumentFragment, integer, integer, integer, array)
#6 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(158): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->run(Wikimedia\Parsoid\Config\Env, Wikimedia\Parsoid\DOM\DocumentFragment, array, boolean)
#7 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(848): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->Wikimedia\Parsoid\Wt2Html\{closure}(Wikimedia\Parsoid\DOM\DocumentFragment, array, boolean)
#8 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(889): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->doPostProcess(Wikimedia\Parsoid\DOM\DocumentFragment)
#9 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(140): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->process(Wikimedia\Parsoid\DOM\DocumentFragment, array)
#10 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Utils/PipelineUtils.php(105): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parse(array, array)
#11 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TT/DOMFragmentBuilder.php(101): Wikimedia\Parsoid\Utils\PipelineUtils::processContentInPipeline(Wikimedia\Parsoid\Config\Env, Wikimedia\Parsoid\Wt2Html\PageConfigFrame, array, array)
#12 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TT/DOMFragmentBuilder.php(124): Wikimedia\Parsoid\Wt2Html\TT\DOMFragmentBuilder->buildDOMFragment(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#13 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TT/TokenHandler.php(150): Wikimedia\Parsoid\Wt2Html\TT\DOMFragmentBuilder->onTag(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#14 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(132): Wikimedia\Parsoid\Wt2Html\TT\TokenHandler->process(array)
#15 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(195): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunk(array)
#16 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(193): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#17 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/TreeBuilder/TreeBuilderStage.php(487): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#18 [internal function]: Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage->processChunkily(string, array)
#19 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(903): Generator->current()
#20 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(180): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#21 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipelineFactory.php(308): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#22 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wikitext/ContentModelHandler.php(123): Wikimedia\Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#23 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Parsoid.php(172): Wikimedia\Parsoid\Wikitext\ContentModelHandler->toDOM(Wikimedia\Parsoid\Ext\ParsoidExtensionAPI)
#24 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Parsoid.php(210): Wikimedia\Parsoid\Parsoid->parseWikitext(MediaWiki\Parser\Parsoid\Config\PageConfig, ParserOutput, array)
#25 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php(585): Wikimedia\Parsoid\Parsoid->wikitext2html(MediaWiki\Parser\Parsoid\Config\PageConfig, array, NULL, ParserOutput)
#26 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php(88): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(MediaWiki\Parser\Parsoid\Config\PageConfig, array)
#27 /srv/mediawiki/php-1.39.0-wmf.19/includes/Rest/Router.php(424): MWParsoid\Rest\Handler\PageHandler->execute()
#28 /srv/mediawiki/php-1.39.0-wmf.19/includes/Rest/Router.php(343): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#29 /srv/mediawiki/php-1.39.0-wmf.19/includes/Rest/EntryPoint.php(171): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#30 /srv/mediawiki/php-1.39.0-wmf.19/includes/Rest/EntryPoint.php(136): MediaWiki\Rest\EntryPoint->execute()
#31 /srv/mediawiki/php-1.39.0-wmf.19/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#32 /srv/mediawiki/w/rest.php(3): require(string)
#33 {main}
Impact
Notes

Details

Request URL
https://de.wikipedia.org/w/rest.php/de.wikipedia.org/v3/page/pagebundle/Parlamentswahl_in_Griechenland_Januar_2015/215124436

Event Timeline

JMcLeod_WMF moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

This is bizarre. Consider this stack trace:

#0 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(147): Wikimedia\Parsoid\Utils\DOMCompat::nodeName(NULL)
#1 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(256): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeListEltWidth(NULL)
#2 /srv/mediawiki/php-1.39.0-wmf.19/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/ComputeDSR.php(505): Wikimedia\Parsoid\Wt2Html\PP\Processors\ComputeDSR->computeTagWidths(NULL, NULL, Wikimedia\Parsoid\DOM\Element, Wikimedia\Parsoid\NodeData\DataParsoid)

So, computeTagWidths got a legitimate non-null node. On line 255 (in computeTagWidths function), there is a DOMUtils::assertElt(..) which clearly passed without throwing an exception. But, on the next line, $node is null?

The while loop has $li = $li->parentNode->parentNode; though, so as you traverse up the tree you eventually get to a null

That is true, but I was referring to the 2nd element in the trace which says the arg to computeListEltWidth is NULL.

$li that is an argument to computeListEltWidth is reassigned in the loop so maybe the trace is confused

Change 818237 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Prevent traversing too far up the tree in computeListEltWidth

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

Change 818237 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Prevent traversing too far up the tree in computeListEltWidth

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

Change 819170 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a18

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

Change 819170 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a18

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