Page MenuHomePhabricator

TypeError: Argument 1 passed to MediaWiki\Languages\LanguageNameUtils::isValidCode() must be of the type string, array given, called in /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLi
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to MediaWiki\Languages\LanguageNameUtils::isValidCode() must be of the type string, array given, called in /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLi
exception.trace
from /srv/mediawiki/php-1.42.0-wmf.24/includes/language/LanguageNameUtils.php(136)
#0 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLibrary.php(197): MediaWiki\Languages\LanguageNameUtils->isValidCode(array)
#1 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLibrary.php(66): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LanguageLibrary->languageMethod(string, array)
#2 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaSandbox/LuaSandboxCallback.php(31): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LanguageLibrary->MediaWiki\Extension\Scribunto\Engines\LuaCommon\{closure}(array, string, string)
#3 [internal function]: MediaWiki\Extension\Scribunto\Engines\LuaSandbox\LuaSandboxCallback->__call(string, array)
#4 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaSandbox/LuaSandboxInterpreter.php(136): LuaSandboxFunction->call(LuaSandboxFunction)
#5 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LuaEngine.php(313): MediaWiki\Extension\Scribunto\Engines\LuaSandbox\LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#6 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LuaModule.php(75): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#7 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Hooks.php(177): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LuaModule->invoke(string, PPTemplateFrame_Hash)
#8 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parser.php(3417): MediaWiki\Extension\Scribunto\Hooks->invokeHook(MediaWiki\Parser\Parser, PPTemplateFrame_Hash, array)
#9 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parser.php(3102): MediaWiki\Parser\Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#10 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/PPFrame_Hash.php(275): MediaWiki\Parser\Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#11 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parser.php(3293): PPFrame_Hash->expand(PPNode_Hash_Tree)
#12 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/PPFrame_Hash.php(275): MediaWiki\Parser\Parser->braceSubstitution(array, PPFrame_Hash)
#13 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parser.php(2936): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#14 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parsoid/Config/DataAccess.php(386): MediaWiki\Parser\Parser->replaceVariables(string, PPFrame_Hash)
#15 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wikitext/Wikitext.php(43): MediaWiki\Parser\Parsoid\Config\DataAccess->preprocessWikitext(MediaWiki\Parser\Parsoid\Config\PageConfig, MediaWiki\Parser\ParserOutput, string)
#16 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1067): Wikimedia\Parsoid\Wikitext\Wikitext::preprocess(Wikimedia\Parsoid\Config\Env, string)
#17 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1110): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->expandTemplate(Wikimedia\Parsoid\Wt2Html\TT\TemplateEncapsulator)
#18 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1151): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTemplate(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#19 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TT/TokenHandler.php(138): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTag(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#20 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(113): Wikimedia\Parsoid\Wt2Html\TT\TokenHandler->process(array)
#21 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(176): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunk(array)
#22 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TokenTransformManager.php(174): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#23 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/TreeBuilder/TreeBuilderStage.php(476): Wikimedia\Parsoid\Wt2Html\TokenTransformManager->processChunkily(string, array)
#24 [internal function]: Wikimedia\Parsoid\Wt2Html\TreeBuilder\TreeBuilderStage->processChunkily(string, array)
#25 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(963): Generator->current()
#26 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(170): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array)
#27 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipelineFactory.php(279): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array)
#28 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Wikitext/ContentModelHandler.php(161): Wikimedia\Parsoid\Wt2Html\ParserPipelineFactory->parse(string)
#29 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Parsoid.php(191): Wikimedia\Parsoid\Wikitext\ContentModelHandler->toDOM(Wikimedia\Parsoid\Ext\ParsoidExtensionAPI)
#30 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/src/Parsoid.php(232): Wikimedia\Parsoid\Parsoid->parseWikitext(MediaWiki\Parser\Parsoid\Config\PageConfig, MediaWiki\Parser\ParserOutput, array)
#31 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parsoid/ParsoidParser.php(149): Wikimedia\Parsoid\Parsoid->wikitext2html(MediaWiki\Parser\Parsoid\Config\PageConfig, array, NULL, MediaWiki\Parser\ParserOutput)
#32 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parsoid/ParsoidParser.php(253): MediaWiki\Parser\Parsoid\ParsoidParser->genParserOutput(MediaWiki\Parser\Parsoid\Config\PageConfig, ParserOptions)
#33 /srv/mediawiki/php-1.42.0-wmf.24/includes/content/WikitextContentHandler.php(376): MediaWiki\Parser\Parsoid\ParsoidParser->parse(string, MediaWiki\Title\Title, ParserOptions, boolean, boolean, integer)
#34 /srv/mediawiki/php-1.42.0-wmf.24/includes/content/ContentHandler.php(1664): WikitextContentHandler->fillParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#35 /srv/mediawiki/php-1.42.0-wmf.24/includes/content/Renderer/ContentRenderer.php(67): ContentHandler->getParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#36 /srv/mediawiki/php-1.42.0-wmf.24/includes/Revision/RenderedRevision.php(260): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(WikitextContent, MediaWiki\Title\Title, MediaWiki\Revision\RevisionStoreRecord, ParserOptions, boolean)
#37 /srv/mediawiki/php-1.42.0-wmf.24/includes/Revision/RenderedRevision.php(232): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#38 /srv/mediawiki/php-1.42.0-wmf.24/includes/Revision/RevisionRenderer.php(226): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#39 /srv/mediawiki/php-1.42.0-wmf.24/includes/Revision/RevisionRenderer.php(164): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, ParserOptions, array)
#40 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#41 /srv/mediawiki/php-1.42.0-wmf.24/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#42 /srv/mediawiki/php-1.42.0-wmf.24/includes/page/ParserOutputAccess.php(379): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#43 /srv/mediawiki/php-1.42.0-wmf.24/includes/page/ParserOutputAccess.php(330): MediaWiki\Page\ParserOutputAccess->renderRevision(MediaWiki\Page\PageStoreRecord, ParserOptions, MediaWiki\Revision\RevisionStoreRecord, integer)
#44 /srv/mediawiki/php-1.42.0-wmf.24/includes/parser/Parsoid/ParsoidOutputAccess.php(135): MediaWiki\Page\ParserOutputAccess->getParserOutput(MediaWiki\Page\PageStoreRecord, ParserOptions, MediaWiki\Revision\RevisionStoreRecord, integer)
#45 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(779): MediaWiki\Parser\Parsoid\ParsoidOutputAccess->getParserOutput(MediaWiki\Page\PageStoreRecord, ParserOptions, MediaWiki\Revision\RevisionStoreRecord, integer, boolean)
#46 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(587): MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getParserOutputInternal(ParserOptions)
#47 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(678): MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getParserOutput()
#48 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Handler/ParsoidHandler.php(732): MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getPageBundle()
#49 /srv/mediawiki/php-1.42.0-wmf.24/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php(92): MediaWiki\Rest\Handler\ParsoidHandler->wt2html(MediaWiki\Parser\Parsoid\Config\PageConfig, array)
#50 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Router.php(565): MWParsoid\Rest\Handler\PageHandler->execute()
#51 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/Router.php(455): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler)
#52 /srv/mediawiki/php-1.42.0-wmf.24/includes/Rest/EntryPoint.php(216): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#53 /srv/mediawiki/php-1.42.0-wmf.24/includes/MediaWikiEntryPoint.php(199): MediaWiki\Rest\EntryPoint->execute()
#54 /srv/mediawiki/php-1.42.0-wmf.24/rest.php(38): MediaWiki\MediaWikiEntryPoint->run()
#55 /srv/mediawiki/w/rest.php(3): require(string)
#56 {main}
Impact
Notes

Details

Request URL
https://ja.wikipedia.org/w/rest.php/ja.wikipedia.org/v3/page/pagebundle/%E5%88%A9%E7%94%A8%E8%80%85%3ASTS2657%2Fsandbox%2F2/88430265

Event Timeline

PHP Warning: Illegal offset type in isset or empty is also seen around this. Stack trace for that is

from /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLibrary.php(192)
#0 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLibrary.php(192): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaCommon/LanguageLibrary.php(66): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LanguageLibrary->languageMethod(string, array)
#2 /srv/mediawiki/php-1.42.0-wmf.24/extensions/Scribunto/includes/Engines/LuaSandbox/LuaSandboxCallback.php(31): MediaWiki\Extension\Scribunto\Engines\LuaCommon\LanguageLibrary->MediaWiki\Extension\Scribunto\Engines\LuaCommon\{closure}(array, string, string)
#3 [internal function]: MediaWiki\Extension\Scribunto\Engines\LuaSandbox\LuaSandboxCallback->__call(string, array)
...

Change #1017063 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/extensions/Scribunto@master] LanguageLibrary: Ensure language code is a string

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

Change #1017063 merged by jenkins-bot:

[mediawiki/extensions/Scribunto@master] LanguageLibrary: Ensure language code is a string

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

ABreault-WMF subscribed.

Looks like an assertion would be hit now, rather then crashing randomly