Page MenuHomePhabricator

TypeError from Wikibase: Argument 1 passed to extractForeignIdStringSpecialNs() must implement interface MediaWiki\Linker\LinkTarget, null given, called in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
[ef24d542-32e3-4429-bd12-6b3574e86fd4] 2020-08-19 19:34:53: Fatal exception of type "TypeError"
Impact

The page with the given doesn’t load while logged in. Not sure how widespread the error is.

Notes

The same URL loads anonymously. Both the logged-in error and the logged-out non-error seems reproducible.

Details

Request ID
ef24d542-32e3-4429-bd12-6b3574e86fd4
Request URL
https://commons.wikimedia.org/w/index.php?title=User_talk:Steinsplitter&diff=0&oldid=440352691&uselang=en
Stack Trace
Stack Trace
#0 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(448): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->extractForeignIdStringSpecialNs(NULL)
#1 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(440): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->extractForeignIdStringMainNs(Title)
#2 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(419): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->extractForeignIdString(Title)
#3 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(307): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->parseForeignEntityId(Title)
#4 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(248): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->internalDoHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, Title, HtmlArmor, array, RequestContext, Wikibase\Repo\Hooks\Formatters\EntityLinkFormatterFactory, NULL)
#5 /srv/mediawiki/php-1.36.0-wmf.5/extensions/Wikibase/repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php(175): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->doHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, Title, HtmlArmor, array, RequestContext, NULL)
#6 /srv/mediawiki/php-1.36.0-wmf.5/includes/HookContainer/HookContainer.php(154): Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler->onHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, Title, boolean, HtmlArmor, array, NULL)
#7 /srv/mediawiki/php-1.36.0-wmf.5/includes/HookContainer/HookRunner.php(2069): MediaWiki\HookContainer\HookContainer->run(string, array)
#8 /srv/mediawiki/php-1.36.0-wmf.5/includes/linker/LinkRenderer.php(308): MediaWiki\HookContainer\HookRunner->onHtmlPageLinkRendererEnd(MediaWiki\Linker\LinkRenderer, Title, boolean, HtmlArmor, array, NULL)
#9 /srv/mediawiki/php-1.36.0-wmf.5/includes/linker/LinkRenderer.php(215): MediaWiki\Linker\LinkRenderer->buildAElement(Title, HtmlArmor, array, boolean)
#10 /srv/mediawiki/php-1.36.0-wmf.5/includes/linker/LinkRenderer.php(242): MediaWiki\Linker\LinkRenderer->makePreloadedLink(Title, HtmlArmor, string, array, array)
#11 /srv/mediawiki/php-1.36.0-wmf.5/includes/linker/LinkRenderer.php(165): MediaWiki\Linker\LinkRenderer->makeKnownLink(Title, HtmlArmor, array, array)
#12 /srv/mediawiki/php-1.36.0-wmf.5/includes/parser/LinkHolderArray.php(326): MediaWiki\Linker\LinkRenderer->makeLink(Title, HtmlArmor)
#13 /srv/mediawiki/php-1.36.0-wmf.5/includes/parser/LinkHolderArray.php(167): LinkHolderArray->replaceInterwiki(string)
#14 /srv/mediawiki/php-1.36.0-wmf.5/includes/parser/Parser.php(4948): LinkHolderArray->replace(string)
#15 /srv/mediawiki/php-1.36.0-wmf.5/includes/parser/Parser.php(1658): Parser->replaceLinkHoldersPrivate(string)
#16 /srv/mediawiki/php-1.36.0-wmf.5/includes/parser/Parser.php(654): Parser->internalParseHalfParsed(string, boolean, boolean)
#17 /srv/mediawiki/php-1.36.0-wmf.5/includes/content/WikitextContent.php(374): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#18 /srv/mediawiki/php-1.36.0-wmf.5/includes/content/AbstractContent.php(590): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#19 /srv/mediawiki/php-1.36.0-wmf.5/includes/Revision/RenderedRevision.php(266): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#20 /srv/mediawiki/php-1.36.0-wmf.5/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#21 /srv/mediawiki/php-1.36.0-wmf.5/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#22 /srv/mediawiki/php-1.36.0-wmf.5/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#23 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#24 /srv/mediawiki/php-1.36.0-wmf.5/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#25 /srv/mediawiki/php-1.36.0-wmf.5/includes/poolcounter/PoolWorkArticleView.php(216): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#26 /srv/mediawiki/php-1.36.0-wmf.5/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#27 /srv/mediawiki/php-1.36.0-wmf.5/includes/page/WikiPage.php(1245): PoolCounterWork->execute()
#28 /srv/mediawiki/php-1.36.0-wmf.5/includes/diff/DifferenceEngine.php(1094): WikiPage->getParserOutput(ParserOptions, integer)
#29 /srv/mediawiki/php-1.36.0-wmf.5/includes/diff/DifferenceEngine.php(1051): DifferenceEngine->getParserOutput(WikiPage, MediaWiki\Revision\RevisionStoreRecord)
#30 /srv/mediawiki/php-1.36.0-wmf.5/includes/diff/DifferenceEngine.php(879): DifferenceEngine->renderNewRevision()
#31 /srv/mediawiki/php-1.36.0-wmf.5/includes/page/Article.php(981): DifferenceEngine->showDiffPage(boolean)
#32 /srv/mediawiki/php-1.36.0-wmf.5/includes/page/Article.php(657): Article->showDiffPage()
#33 /srv/mediawiki/php-1.36.0-wmf.5/includes/actions/ViewAction.php(74): Article->view()
#34 /srv/mediawiki/php-1.36.0-wmf.5/includes/MediaWiki.php(527): ViewAction->show()
#35 /srv/mediawiki/php-1.36.0-wmf.5/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
#36 /srv/mediawiki/php-1.36.0-wmf.5/includes/MediaWiki.php(940): MediaWiki->performRequest()
#37 /srv/mediawiki/php-1.36.0-wmf.5/includes/MediaWiki.php(543): MediaWiki->main()
#38 /srv/mediawiki/php-1.36.0-wmf.5/index.php(53): MediaWiki->run()
#39 /srv/mediawiki/php-1.36.0-wmf.5/index.php(46): wfIndexMain()
#40 /srv/mediawiki/w/index.php(3): require(string)
#41 {main}

Event Timeline

Aklapper renamed this task from TypeError on Commons to TypeError from Wikibase: Argument 1 passed to extractForeignIdStringSpecialNs() must implement interface MediaWiki\Linker\LinkTarget, null given, called in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php.Aug 19 2020, 8:03 PM
Aklapper updated the task description. (Show Details)
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to fa82c967b6c0f61e0c43598f3c6a43fd778205d009970566cc18d5b97d03b48e.

Change 621474 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/Wikibase@master] TypeError on commons Title::newFromText returning null

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

Since this is only happening on commons, I'm adding the respective projects.

This is the patch that caused this https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/618991

The suggested fix would allow the links to take the same path as before this was merged.

Change 621474 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] TypeError on commons Title::newFromText returning null

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

Looks very low frequency, sow ill just wait for this to be rolled out with the train rather than backporting it!

Change 813240 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] HtmlPageLinkRendererEndHookHandlerTest: Populate interwiki table

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

Change 813240 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] HtmlPageLinkRendererEndHookHandlerTest: Populate interwiki table

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