Page MenuHomePhabricator

Fatal error from LinkRenderer on Special:MostLinkedCategories ("Object of class HtmlArmor could not be converted")
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: W6pzpArAADkAAJUF3vEAAABJ

message
PHP Error: Object of class HtmlArmor could not be converted to string
stacktrace
#1 /srv/mediawiki/php-1.32.0-wmf.23/includes/linker/LinkRenderer.php(382): Html::rawElement(string, array, HtmlArmor)
#2 /srv/mediawiki/php-1.32.0-wmf.23/includes/linker/LinkRenderer.php(271): MediaWiki\Linker\LinkRenderer->buildAElement(Title, HtmlArmor, array, boolean)
#3 /srv/mediawiki/php-1.32.0-wmf.23/includes/linker/LinkRenderer.php(299): MediaWiki\Linker\LinkRenderer->makePreloadedLink(Title, HtmlArmor, string, array, array)
#4 /srv/mediawiki/php-1.32.0-wmf.23/includes/linker/LinkRenderer.php(149): MediaWiki\Linker\LinkRenderer->makeKnownLink(Title, HtmlArmor, array, array)
#5 /srv/mediawiki/php-1.32.0-wmf.23/includes/specials/SpecialMostlinkedcategories.php(89): MediaWiki\Linker\LinkRenderer->makeLink(Title, HtmlArmor)
#6 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/QueryPage.php(704): MostlinkedCategoriesPage->formatResult(SkinVector, stdClass)
#7 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/QueryPage.php(672): QueryPage->outputResults(OutputPage, SkinVector, Wikimedia\Rdbms\DatabaseMysqli, Wikimedia\Rdbms\ResultWrapper, integer, integer)
#8 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/SpecialPage.php(569): QueryPage->execute(NULL)
#9 /srv/mediawiki/php-1.32.0-wmf.23/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(868): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(525): MediaWiki->main()
#13 /srv/mediawiki/php-1.32.0-wmf.23/index.php(42): MediaWiki->run()

Notes

The following url is unavailable with an HTTP 500 Server Error response.

  • https://www.mediawiki.org/wiki/Special:MostLinkedCategories

This error is new in 1.32.0-wmf.23, marking as regression.

Event Timeline

Krinkle created this task.Sep 25 2018, 6:12 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 25 2018, 6:12 PM
zeljkofilipin triaged this task as Unbreak Now! priority.Sep 26 2018, 8:10 AM
zeljkofilipin added a subscriber: zeljkofilipin.

Changing priority to 😱Unbreak Now!🤯 since it's blocking the train!

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptSep 26 2018, 8:10 AM
		$text = MediaWikiServices::getInstance()->getContentLanguage()
			->convert( new HtmlArmor( $nt->getText() ) );
		$plink = $this->getLinkRenderer()->makeLink( $nt, new HtmlArmor( $text ) );

Looks like we wrap $text in a HtmlArmor twice, so that when makeLink() unwraps it, it still gets a HtmlArmor object instead of a string.

This also probably fails in interesting ways on wikis with language conversion (on wikis without, the convert() call just returns the parameter unchanged).

Caused by rMWa89ef9b3b9cc: Fix some double escaping, and some incorrect escaping for convert()

Change 463067 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] Fix double-wrapped HtmlArmor causing fatals

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

Reedy renamed this task from Fatal error from LinkRenderer on special pages ("Object of class HtmlArmor could not be converted") to Fatal error from LinkRenderer on Special:MostLinkedCategories ("Object of class HtmlArmor could not be converted").Sep 26 2018, 2:03 PM

Change 463073 had a related patch set uploaded (by Reedy; owner: Bartosz Dziewoński):
[mediawiki/core@wmf/1.32.0-wmf.23] Fix double-wrapped HtmlArmor causing fatals

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

Reedy assigned this task to matmarex.Sep 26 2018, 2:04 PM

Change 463067 merged by jenkins-bot:
[mediawiki/core@master] Fix double-wrapped HtmlArmor causing fatals

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

Change 463073 merged by jenkins-bot:
[mediawiki/core@wmf/1.32.0-wmf.23] Fix double-wrapped HtmlArmor causing fatals

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

Mentioned in SAL (#wikimedia-operations) [2018-09-26T14:48:03Z] <reedy@deploy1001> Synchronized php-1.32.0-wmf.23/includes/specials/SpecialMostlinkedcategories.php: T205469 (duration: 00m 55s)

Reedy closed this task as Resolved.Sep 26 2018, 2:48 PM
Reedy removed a project: Patch-For-Review.
Reedy removed a project: MediaWiki-General.
Reedy updated the task description. (Show Details)
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM