Page MenuHomePhabricator

Argument 1 passed to Parsoid\Wt2Html\TokenTransformManager::processChunk() must be of the type array, boolean given
Closed, DuplicatePublic

Description

Error

message
Argument 1 passed to Parsoid\Wt2Html\TokenTransformManager::processChunk() must be of the type array, boolean given, called in /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TokenTransformManager.php on line 182

Details

Request ID
XdS6@wpAAE0AAAwgsNIAAABW
Request URL
https://en.wikipedia.org/w/rest.php/en.wikipedia.org/v3/page/pagebundle/Module%3AEscape%2Fdoc/922764224
Stack Trace
exception.trace
#0 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TokenTransformManager.php(182): Parsoid\Wt2Html\TokenTransformManager->processChunk(boolean)
#1 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/ParserPipeline.php(127): Parsoid\Wt2Html\TokenTransformManager->process(boolean, array)
#2 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Utils/PipelineUtils.php(110): Parsoid\Wt2Html\ParserPipeline->parse(string, array)
#3 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TT/TemplateHandler.php(621): Parsoid\Utils\PipelineUtils::processContentInPipeline(Parsoid\Config\Env, Parsoid\Wt2Html\PageConfigFrame, string, array)
#4 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TT/TemplateHandler.php(1404): Parsoid\Wt2Html\TT\TemplateHandler->processTemplateSource(array, array, string)
#5 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TT/TemplateHandler.php(1456): Parsoid\Wt2Html\TT\TemplateHandler->onTemplate(Parsoid\Tokens\SelfclosingTagTk)
#6 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TT/TokenHandler.php(211): Parsoid\Wt2Html\TT\TemplateHandler->onTag(Parsoid\Tokens\SelfclosingTagTk)
#7 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TokenTransformManager.php(120): Parsoid\Wt2Html\TT\TokenHandler->process(array)
#8 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TokenTransformManager.php(192): Parsoid\Wt2Html\TokenTransformManager->processChunk(array)
#9 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/TokenTransformManager.php(190): Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#10 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/HTML5TreeBuilder.php(430): Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#11 [internal function]: Parsoid\Wt2Html\HTML5TreeBuilder->processChunkily(string, array)
#12 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/DOMPostProcessor.php(894): Generator->current()
#13 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/ParserPipeline.php(148): Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#14 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/ParserPipeline.php(198): Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#15 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Wt2Html/ParserPipelineFactory.php(299): Parsoid\Wt2Html\ParserPipeline->parseToplevelDoc(string, array)
#16 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/WikitextContentModelHandler.php(78): Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#17 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Parsoid.php(86): Parsoid\WikitextContentModelHandler->toHTML(Parsoid\Config\Env)
#18 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/src/Parsoid.php(113): Parsoid\Parsoid->parseWikitext(MWParsoid\Config\PageConfig, array)
#19 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/extension/src/Rest/Handler/ParsoidHandler.php(564): Parsoid\Parsoid->wikitext2html(MWParsoid\Config\PageConfig, array, NULL)
#20 /srv/deployment/parsoid/deploy-cache/revs/c6a457fbfdc7b0a5d0fbd6dd146a3ca23ad8bea5/src/extension/src/Rest/Handler/PageHandler.php(52): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(Parsoid\Config\Env, array)
#21 /srv/mediawiki/php-1.35.0-wmf.5/includes/Rest/Router.php(315): MWParsoid\Rest\Handler\PageHandler->execute()
#22 /srv/mediawiki/php-1.35.0-wmf.5/includes/Rest/Router.php(285): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#23 /srv/mediawiki/php-1.35.0-wmf.5/includes/Rest/EntryPoint.php(116): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#24 /srv/mediawiki/php-1.35.0-wmf.5/includes/Rest/EntryPoint.php(83): MediaWiki\Rest\EntryPoint->execute()
#25 /srv/mediawiki/php-1.35.0-wmf.5/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#26 /srv/mediawiki/w/rest.php(3): require(string)
#27 {main}

Event Timeline

ssastry created this task.Nov 20 2019, 2:39 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 20 2019, 2:39 PM
ssastry triaged this task as Medium priority.Nov 20 2019, 2:40 PM
Sbailey claimed this task.Dec 17 2019, 6:00 PM

I believe this is a duplicate of T238845 and is triggered by an editor electing to 'suppress' an edit revision which then causes the Api/PageConfig.php code call to makeRequest( ... ) to return associative array missing the ['pages'] elements appropriately, but the code then went and attempted to access ['pages'] anyway without protection causing a crash.
The fix for T238845 seems to fix this case as well.

Change 570101 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] Corrected PAGE_UNAVAILABLE check for invalid RevID

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