Page MenuHomePhabricator

CommentFormatter: TypeError: Argument 1 passed to MediaWiki\CommentFormatter\CommentParser::preprocess() must be of the type string, null given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to MediaWiki\CommentFormatter\CommentParser::preprocess() must be of the type string, null given, called in /srv/mediawiki/php-1.38.0-wmf.3/includes/CommentFormatter/CommentFormatter.php on line 173
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.3/includes/CommentFormatter/CommentParser.php(109)
#0 /srv/mediawiki/php-1.38.0-wmf.3/includes/CommentFormatter/CommentFormatter.php(173): MediaWiki\CommentFormatter\CommentParser->preprocess(NULL, Title, boolean, boolean)
#1 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImageHistoryPseudoPager.php(138): MediaWiki\CommentFormatter\CommentFormatter->formatStrings(array, Title)
#2 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImagePage.php(838): ImageHistoryPseudoPager->getBody()
#3 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImagePage.php(183): ImagePage->imageHistory()
#4 /srv/mediawiki/php-1.38.0-wmf.3/includes/actions/ViewAction.php(74): ImagePage->view()
#5 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(538): ViewAction->show()
#6 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(320): MediaWiki->performAction(ImagePage, Title)
#7 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(925): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(559): MediaWiki->main()
#9 /srv/mediawiki/php-1.38.0-wmf.3/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.38.0-wmf.3/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}
Impact

1 of these in 1.38.0-wmf.3 (T281167). Fatal error exception message reproducible at URL.

Notes

I assume a similar root to T292570.

Details

Request URL
https://wikitech.wikimedia.org/wiki/File:Cib-graphql_(CoreUI_Icons_v1.0.0).svg

Event Timeline

brennen renamed this task from CommentFormatter: TypeError: Argument 1 passed to MediaWiki\CommentFormatter\CommentParser::preprocess() must be of the type string, null given, called in /srv/mediawiki/php-1.38.0-wmf.3/includes/CommentFormatter/CommentFormatter.php on line 173 to CommentFormatter: TypeError: Argument 1 passed to MediaWiki\CommentFormatter\CommentParser::preprocess() must be of the type string, null given.Oct 7 2021, 10:29 PM
brennen moved this task from Backlog to Logs/Train on the User-brennen board.

Looks like a fallout from https://gerrit.wikimedia.org/r/c/mediawiki/core/+/726594.

We are now calling $file->getDescription on foreign files aswell. But that can return null, which then results in a TypeError.

Noting from discussion in train log triage meeting that I probably ought to have blocked wmf.3 on this one. I didn't quite process @Zabe's comment to the effect that this was a regression due to the fix for T292570.

Should this block a future train? It's happening a bit more often now (like over 10 times on some days).

Change 732322 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] Don't pass nulls to CommentFormatter::formatStrings

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

Change 732322 merged by jenkins-bot:

[mediawiki/core@master] Don't pass nulls to CommentFormatter::formatStrings

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

Pchelolo claimed this task.