Page MenuHomePhabricator

StripState: PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error
  • service.version: 1.46.0-wmf.11
  • timestamp: 2026-01-20T02:17:14.400Z
  • labels.phpversion: 8.3.29
  • trace.id: e371f79c-b160-4858-b8c9-1562781c31c4
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.11/includes/Parser/StripState.php(323)
#0[internal function]MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.46.0-wmf.11/includes/Parser/StripState.php(323)preg_replace_callback(string, Closure, null)
#2/srv/mediawiki/php-1.46.0-wmf.11/includes/Parser/StripState.php(133)MediaWiki\Parser\StripState->unstripType(string, null)
#3/srv/mediawiki/php-1.46.0-wmf.11/includes/Parser/Parser.php(1633)MediaWiki\Parser\StripState->unstripGeneral(null)
#4/srv/mediawiki/php-1.46.0-wmf.11/includes/Parser/Parser.php(627)MediaWiki\Parser\Parser->internalParseHalfParsed(null, bool, bool)
#5/srv/mediawiki/php-1.46.0-wmf.11/includes/Content/WikitextContentHandler.php(375)MediaWiki\Parser\Parser->parse(null, MediaWiki\Title\Title, MediaWiki\Parser\ParserOptions, bool, bool, int)
#6/srv/mediawiki/php-1.46.0-wmf.11/includes/Content/ContentHandler.php(1574)MediaWiki\Content\WikitextContentHandler->fillParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#7/srv/mediawiki/php-1.46.0-wmf.11/includes/Content/Renderer/ContentRenderer.php(67)MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#8/srv/mediawiki/php-1.46.0-wmf.11/includes/Revision/RenderedRevision.php(246)MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Page\PageIdentityValue, MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Parser\ParserOptions, array)
#9/srv/mediawiki/php-1.46.0-wmf.11/includes/Revision/RenderedRevision.php(219)MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Content\WikitextContent, array)
#10/srv/mediawiki/php-1.46.0-wmf.11/includes/Revision/RevisionRenderer.php(225)MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#11/srv/mediawiki/php-1.46.0-wmf.11/includes/Revision/RevisionRenderer.php(158)MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, MediaWiki\Parser\ParserOptions, array)
#12/srv/mediawiki/php-1.46.0-wmf.11/includes/Revision/RenderedRevision.php(182)MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#13/srv/mediawiki/php-1.46.0-wmf.11/includes/Page/ParserOutputAccess.php(590)MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#14/srv/mediawiki/php-1.46.0-wmf.11/includes/Page/ParserOutputAccess.php(505)MediaWiki\Page\ParserOutputAccess->renderRevision(MediaWiki\Page\WikiPage, MediaWiki\Parser\ParserOptions, MediaWiki\Revision\RevisionStoreRecord, array, null)
#15/srv/mediawiki/php-1.46.0-wmf.11/includes/Diff/DifferenceEngine.php(1265)MediaWiki\Page\ParserOutputAccess->getParserOutput(MediaWiki\Page\WikiPage, MediaWiki\Parser\ParserOptions, MediaWiki\Revision\RevisionStoreRecord, array)
#16/srv/mediawiki/php-1.46.0-wmf.11/includes/Diff/DifferenceEngine.php(1055)MediaWiki\Diff\DifferenceEngine->renderNewRevision()
#17/srv/mediawiki/php-1.46.0-wmf.11/includes/Page/Article.php(1118)MediaWiki\Diff\DifferenceEngine->showDiffPage(bool)
#18/srv/mediawiki/php-1.46.0-wmf.11/includes/Page/Article.php(471)MediaWiki\Page\Article->showDiffPage()
#19/srv/mediawiki/php-1.46.0-wmf.11/includes/Actions/ViewAction.php(71)MediaWiki\Page\Article->view()
#20/srv/mediawiki/php-1.46.0-wmf.11/includes/Actions/ActionEntryPoint.php(739)MediaWiki\Actions\ViewAction->show()
#21/srv/mediawiki/php-1.46.0-wmf.11/includes/Actions/ActionEntryPoint.php(510)MediaWiki\Actions\ActionEntryPoint->performAction(MediaWiki\Page\Article, MediaWiki\Title\Title)
#22/srv/mediawiki/php-1.46.0-wmf.11/includes/Actions/ActionEntryPoint.php(144)MediaWiki\Actions\ActionEntryPoint->performRequest()
#23/srv/mediawiki/php-1.46.0-wmf.11/includes/MediaWikiEntryPoint.php(181)MediaWiki\Actions\ActionEntryPoint->execute()
#24/srv/mediawiki/php-1.46.0-wmf.11/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#25/srv/mediawiki/w/index.php(3)require(string)
#26{main}
Impact

Low.

Notes

See also slightly similar resolved T388820 for CharInsert instead of ContentHandler

Details

MediaWiki Version
1.46.0-wmf.11
Request URL
https://meta.wikimedia.org/w/index.php?diff=*&oldid=*&title=*

Event Timeline

We're getting a lot of these, and my feeling is that the root cause is bad UTF-8 that we're allowing into the parser pipeline somehow (from an extension, from the database, from...?). That eventually causes a preg_* method to return null, and then that null propagates out and causes something somewhere else to fail. [Parser: enforce @return string types, and types of private methods (1247112) · Gerrit Code Review](https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1247112) attempts to move the enforcement boundary slightly earlier, in the process of fixing T415068: PHP Deprecated: substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated, which is another bug of the same sort. T414712: PHP Deprecated: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated is also similar, and was fixed in Parser: handleMagicLinks should always return string (1235811) · Gerrit Code Review by a patch which avoided the null by allowed the bad UTF-8 to leak out of the method, where it will probably cause Yet Another of these "anomalous null" bugs.