Page MenuHomePhabricator

PHP Fatal error: Out of memory in cdb/src/Reader/DBA.php (via BlockManager.php)
Closed, DeclinedPublicPRODUCTION ERROR

Description

Error message
Out of memory (allocated 2097152) (tried to allocate 1159168 bytes) in DBA.php
Stack Trace
#0 [internal function]: unknown()
#1 /srv/mediawiki/php-1.36.0-wmf.3/vendor/wikimedia/cdb/src/Reader/DBA.php(48): dba_fetch()
#2 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/localisation/LCStoreCDB.php(71): Cdb\Reader\DBA->get()
#3 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/localisation/LocalisationCache.php(394): LCStoreCDB->get()
#4 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/localisation/LocalisationCache.php(408): LocalisationCache->loadItem()
#5 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/localisation/LocalisationCache.php(333): LocalisationCache->loadSubitem()
#6 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/localisation/LocalisationCache.php(353): LocalisationCache->getSubitem()
#7 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/MessageCache.php(289): LocalisationCache->getSubitemList()
#8 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/MessageCache.php(1091): MessageCache->load()
#9 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/MessageCache.php(1018): MessageCache->getMsgFromNamespace()
#10 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/MessageCache.php(988): MessageCache->getMessageForLang()
#11 /srv/mediawiki/php-1.36.0-wmf.3/includes/cache/MessageCache.php(930): MessageCache->getMessageFromFallbackChain()
#12 /srv/mediawiki/php-1.36.0-wmf.3/includes/language/Message.php(1304): MessageCache->get()
#13 /srv/mediawiki/php-1.36.0-wmf.3/includes/language/Message.php(862): Message->fetchMessage()
#14 /srv/mediawiki/php-1.36.0-wmf.3/includes/language/Message.php(954): Message->toString()
#15 /srv/mediawiki/php-1.36.0-wmf.3/includes/CommentStoreComment.php(85): Message->text()
#16 /srv/mediawiki/php-1.36.0-wmf.3/includes/block/AbstractBlock.php(183): CommentStoreComment::newUnsavedComment()
#17 /srv/mediawiki/php-1.36.0-wmf.3/includes/block/AbstractBlock.php(115): MediaWiki\Block\AbstractBlock->setReason()
#18 /srv/mediawiki/php-1.36.0-wmf.3/includes/block/SystemBlock.php(47): MediaWiki\Block\AbstractBlock->__construct()
#19 /srv/mediawiki/php-1.36.0-wmf.3/includes/block/BlockManager.php(225): MediaWiki\Block\SystemBlock->__construct()
#20 /srv/mediawiki/php-1.36.0-wmf.3/includes/block/BlockManager.php(140): MediaWiki\Block\BlockManager->getAdditionalIpBlocks()
#21 /srv/mediawiki/php-1.36.0-wmf.3/includes/user/User.php(1604): MediaWiki\Block\BlockManager->getUserBlock()
#22 /srv/mediawiki/php-1.36.0-wmf.3/includes/user/User.php(1896): User->getBlockedStatus()
#23 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiQueryUserInfo.php(107): User->getBlock()
#24 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiQueryUserInfo.php(53): ApiQueryUserInfo->getCurrentUserInfo()
#25 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiQuery.php(263): ApiQueryUserInfo->execute()
#26 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiMain.php(1593): ApiQuery->execute()
#27 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiMain.php(529): ApiMain->executeAction()
#28 /srv/mediawiki/php-1.36.0-wmf.3/includes/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()
#29 /srv/mediawiki/php-1.36.0-wmf.3/api.php(90): ApiMain->execute()
#30 /srv/mediawiki/php-1.36.0-wmf.3/api.php(45): wfApiMain()
#31 /srv/mediawiki/w/api.php(3): require()
Notes

A similar error was reported in T247223, which was closed as a duplicate of T43103: initialization of the Language object is very heavy.

It seems to have picked up over the last few hours:

image.png (529×668 px, 45 KB)

Details

Request ID
650d9790-a370-4780-8f87-4e3f08de8091

Event Timeline

Reading out a localisation file with CDB takes up a certain amount of memory, but not so much that it would OOM by itself (if that were the case, all of prod would be OOM'ing which it isn't by a long shot). As such, it is also entirely possible that something else in these Meta-Wiki API requests between Babel and Translate is consuming a lot more memory than before (arguably too much), and then the actual OOM might just happen here in the CDB call where it reaches the final threshold.

The same applies here. I'd be good to know what it is about these (BlockManager-specific?) requests that makes it run out of memory. This might be due to memory being allocated prior to the localisation call (where e.g. localisation could merely be the last drop), or it might be due to e.g. something causing initialisation of several language objects when only one should be needed. The latter was the case for T247223 and the Babel/Translate situation.

Krinkle renamed this task from PHP Fatal error: Out of memory in cdb/src/Reader/DBA.php to PHP Fatal error: Out of memory in cdb/src/Reader/DBA.php (via BlockManager.php).Sep 22 2020, 10:59 PM
Krinkle triaged this task as Medium priority.

No longer seen in the past 90 days, based on exception.trace:"DBA.php" AND exception.trace:"BlockManager.php" on mediawiki-errors.