Page MenuHomePhabricator

TypeError: trim() expects parameter 1 to be string, boolean given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: trim() expects parameter 1 to be string, boolean given
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Ext/ImageMap/ImageMap.php(155)
#0 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Ext/ImageMap/ImageMap.php(155): trim(boolean)
#1 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/ExtensionHandler.php(106): Wikimedia\Parsoid\Ext\ImageMap\ImageMap->sourceToDom(Wikimedia\Parsoid\Ext\ParsoidExtensionAPI, string, array)
#2 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/ExtensionHandler.php(290): Wikimedia\Parsoid\Wt2Html\TT\ExtensionHandler->onExtension(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#3 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/TokenHandler.php(150): Wikimedia\Parsoid\Wt2Html\TT\ExtensionHandler->onTag(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#4 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(132): Wikimedia\Parsoid\Wt2Html\TT\TokenHandler->process(array)
#5 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(185): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunk(array)
#6 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(140): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->process(array, array)
#7 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Utils/PipelineUtils.php(105): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parse(string, array)
#8 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(553): Wikimedia\Parsoid\Utils\PipelineUtils::processContentInPipeline(Wikimedia\Parsoid\Config\Env, Wikimedia\Parsoid\Wt2Html\PageConfigFrame, string, array)
#9 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1105): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->processTemplateSource(array, array, string)
#10 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1160): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTemplate(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#11 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TT/TokenHandler.php(150): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTag(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#12 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(132): Wikimedia\Parsoid\Wt2Html\TT\TokenHandler->process(array)
#13 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(195): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunk(array)
#14 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(193): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#15 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/TreeBuilder/TreeBuilderStage.php(487): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#16 [internal function]: Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage->processChunkily(string, array)
#17 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(1040): Generator->current()
#18 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(180): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#19 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipelineFactory.php(308): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#20 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Wikitext/ContentModelHandler.php(122): Wikimedia\Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#21 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Parsoid.php(168): Wikimedia\Parsoid\Wikitext\ContentModelHandler->toDOM(Wikimedia\Parsoid\Ext\ParsoidExtensionAPI)
#22 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/src/Parsoid.php(200): Wikimedia\Parsoid\Parsoid->parseWikitext(MWParsoid\Config\PageConfig, array)
#23 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php(584): Wikimedia\Parsoid\Parsoid->wikitext2html(MWParsoid\Config\PageConfig, array, NULL)
#24 /srv/mediawiki/php-1.38.0-wmf.22/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php(88): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(MWParsoid\Config\PageConfig, array)
#25 /srv/mediawiki/php-1.38.0-wmf.22/includes/Rest/Router.php(414): MWParsoid\Rest\Handler\PageHandler->execute()
#26 /srv/mediawiki/php-1.38.0-wmf.22/includes/Rest/Router.php(338): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#27 /srv/mediawiki/php-1.38.0-wmf.22/includes/Rest/EntryPoint.php(167): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#28 /srv/mediawiki/php-1.38.0-wmf.22/includes/Rest/EntryPoint.php(132): MediaWiki\Rest\EntryPoint->execute()
#29 /srv/mediawiki/php-1.38.0-wmf.22/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#30 /srv/mediawiki/w/rest.php(3): require(string)
#31 {main}
Impact
Notes

Details

Request URL
https://he.wikipedia.org/w/rest.php/he.wikipedia.org/v3/page/pagebundle/%D7%AA%D7%91%D7%A0%D7%99%D7%AA%3A%D7%9E%D7%A4%D7%AA_%D7%AA%D7%9E%D7%95%D7%A0%D7%941/33262180

Event Timeline

This might have been triggered by my 'setting args in frame' patch, but maybe there needs to be some guarding of code in that loop? I don't know that code well, so assigning to you to investigate and fix if necessary.

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

[mediawiki/extensions/ImageMap@master] Account for strtok boolean return type

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

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

[mediawiki/services/parsoid@master] Account for strtok boolean return type

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

Arlolra triaged this task as Medium priority.Feb 25 2022, 11:55 PM

Change 766199 merged by jenkins-bot:

[mediawiki/extensions/ImageMap@master] Account for strtok boolean return type

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

Change 766200 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Account for strtok boolean return type

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

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

[mediawiki/vendor@master] Bump parsoid to 0.15.0-a22

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

Change 766858 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.15.0-a22

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