Page MenuHomePhabricator

Return value of Parsoid\Wt2Html\PP\Processors\WrapSections::getDSR() must be of the type integer, null returned
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

message
Return value of Parsoid\Wt2Html\PP\Processors\WrapSections::getDSR() must be of the type integer, null returned

Notes

Details

Request ID
d681f020-fae7-11e9-9920-e302b7b19678
Request URL
/w/rest.php/ru.wikipedia.org/v3/page/pagebundle/%D0%AE%D1%82%D0%B0_(%D0%BF%D0%B5%D0%B2%D0%B8%D1%86%D0%B0)/103032991
Stack Trace
exception.trace
#0 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/PP/Processors/WrapSections.php(264): Parsoid\Wt2Html\PP\Processors\WrapSections->getDSR(array, DOMElement, boolean)
#1 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/PP/Processors/WrapSections.php(318): Parsoid\Wt2Html\PP\Processors\WrapSections->getDSR(array, DOMElement, boolean)
#2 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/PP/Processors/WrapSections.php(447): Parsoid\Wt2Html\PP\Processors\WrapSections->resolveTplExtSectionConflicts(array)
#3 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/DOMPostProcessor.php(151): Parsoid\Wt2Html\PP\Processors\WrapSections->run(DOMElement, Parsoid\Config\Env, array, boolean)
#4 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/DOMPostProcessor.php(831): Parsoid\Wt2Html\DOMPostProcessor->Parsoid\Wt2Html\{closure}(DOMElement, Parsoid\Config\Env, array, boolean)
#5 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/DOMPostProcessor.php(882): Parsoid\Wt2Html\DOMPostProcessor->doPostProcess(DOMDocument)
#6 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/DOMPostProcessor.php(899): Parsoid\Wt2Html\DOMPostProcessor->process(DOMDocument)
#7 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/ParserPipeline.php(148): Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#8 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/ParserPipeline.php(198): Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#9 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Wt2Html/ParserPipelineFactory.php(308): Parsoid\Wt2Html\ParserPipeline->parseToplevelDoc(string, array)
#10 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/WikitextContentModelHandler.php(78): Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#11 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Parsoid.php(86): Parsoid\WikitextContentModelHandler->toHTML(Parsoid\Config\Env)
#12 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/src/Parsoid.php(113): Parsoid\Parsoid->parseWikitext(MWParsoid\Config\PageConfig, array)
#13 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/extension/src/Rest/Handler/ParsoidHandler.php(591): Parsoid\Parsoid->wikitext2html(MWParsoid\Config\PageConfig, array, NULL)
#14 /srv/deployment/parsoid/deploy-cache/revs/aa59ce3d0aa035504666a63c99667398d0ea1928/src/extension/src/Rest/Handler/PageHandler.php(47): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(Parsoid\Config\Env, array)
#15 /includes/Rest/Router.php(315): MWParsoid\Rest\Handler\PageHandler->execute()
#16 /includes/Rest/Router.php(285): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#17 /includes/Rest/EntryPoint.php(116): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#18 /includes/Rest/EntryPoint.php(83): MediaWiki\Rest\EntryPoint->execute()
#19 /rest.php(31): MediaWiki\Rest\EntryPoint::main()
#20 /srv/mediawiki/w/rest.php(3): require(string)
#21 {main}
Related Changes in Gerrit:

Event Timeline

ssastry triaged this task as Medium priority.Oct 30 2019, 2:43 PM

Looks like this is a case where strong typing leads to a crasher in Parsoid/PHP but which Parsoid/JS silently returned possibly bogus output for. Parsoid/JS returns null which gets coerced to 0 in arithmetic.

We need proper handling for this on the PHP side.

Change 557079 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Separate start/end null test

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

Change 557079 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Separate start/end null test

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

Arlolra claimed this task.

A burst of 116 of these errors occurred in the last 15 minutes.

The following error and backtrace happened an equal number of times:
PHP Notice: Trying to get property 'end' of non-object

exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/WrapSections.php(261): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/WrapSections.php(274): Wikimedia\Parsoid\Wt2Html\PP\Processors\WrapSections->getDSR(array, DOMElement, boolean)
#2 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/WrapSections.php(379): Wikimedia\Parsoid\Wt2Html\PP\Processors\WrapSections->getDSR(array, DOMElement, boolean)
#3 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/PP/Processors/WrapSections.php(448): Wikimedia\Parsoid\Wt2Html\PP\Processors\WrapSections->resolveTplExtSectionConflicts(array)
#4 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(158): Wikimedia\Parsoid\Wt2Html\PP\Processors\WrapSections->run(Wikimedia\Parsoid\Config\Env, DOMElement, array, boolean)
#5 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(848): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->Wikimedia\Parsoid\Wt2Html\{closure}(DOMElement, array, boolean)
#6 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(898): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->doPostProcess(DOMElement)
#7 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(915): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->process(DOMElement)
#8 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(174): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#9 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(235): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#10 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipelineFactory.php(299): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseToplevelDoc(string, array)
#11 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Core/WikitextContentModelHandler.php(107): Wikimedia\Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#12 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Parsoid.php(162): Wikimedia\Parsoid\Core\WikitextContentModelHandler->toDOM(Wikimedia\Parsoid\Config\Env)
#13 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/src/Parsoid.php(194): Wikimedia\Parsoid\Parsoid->parseWikitext(MWParsoid\Config\PageConfig, array)
#14 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php(589): Wikimedia\Parsoid\Parsoid->wikitext2html(MWParsoid\Config\PageConfig, array, NULL)
#15 /srv/mediawiki/php-1.36.0-wmf.16/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php(88): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(MWParsoid\Config\PageConfig, array)
#16 /srv/mediawiki/php-1.36.0-wmf.16/includes/Rest/Router.php(381): MWParsoid\Rest\Handler\PageHandler->execute()
#17 /srv/mediawiki/php-1.36.0-wmf.16/includes/Rest/Router.php(316): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#18 /srv/mediawiki/php-1.36.0-wmf.16/includes/Rest/EntryPoint.php(153): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#19 /srv/mediawiki/php-1.36.0-wmf.16/includes/Rest/EntryPoint.php(117): MediaWiki\Rest\EntryPoint->execute()
#20 /srv/mediawiki/php-1.36.0-wmf.16/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#21 /srv/mediawiki/w/rest.php(3): require(string)
#22 {main}

@cscott will be reviewing the patches in gerrit that handle all (I think)l production crashers related to to WrapSections. We are aiming to get those deployed in the next train.