Page MenuHomePhabricator

Maintenance crash reports confusing DBTransactionError
Closed, ResolvedPublic

Description

When a maintenance script crashes, it almost always ends with DBTransactionError after the real error has already been caught and reported at seemingly the top-level of execution. For example here when facing the (otherwise unrelated and random example of) T258860: LogicException: Process cache for 'en' should be set by now (on translatewiki.net pageviews).

LogicException from line 408 of /srv/mediawiki/php-1.39.0-wmf.6/includes/cache/MessageCache.php: Process cache for 'en' should be set by now.
#0 /srv/mediawiki/php-1.39.0-wmf.6/includes/cache/MessageCache.php(1113): MessageCache->load('en')
#1 /srv/mediawiki/php-1.39.0-wmf.6/includes/cache/MessageCache.php(1041): MessageCache->getMsgFromNamespace('Move-redirect-t...', 'en')
#2 /srv/mediawiki/php-1.39.0-wmf.6/includes/cache/MessageCache.php(1011): MessageCache->getMessageForLang(Object(LanguageEn), 'move-redirect-t...', true, Array)
#3 /srv/mediawiki/php-1.39.0-wmf.6/includes/cache/MessageCache.php(953): MessageCache->getMessageFromFallbackChain(Object(LanguageEn), 'move-redirect-t...', true)
#4 /srv/mediawiki/php-1.39.0-wmf.6/includes/language/Message.php(1491): MessageCache->get('move-redirect-t...', true, Object(LanguageEn))
#5 /srv/mediawiki/php-1.39.0-wmf.6/includes/language/Message.php(968): Message->fetchMessage()
#6 /srv/mediawiki/php-1.39.0-wmf.6/includes/language/Message.php(1082): Message->format('plain')
#7 /srv/mediawiki/php-1.39.0-wmf.6/includes/MovePage.php(890): Message->plain()
#8 /srv/mediawiki/php-1.39.0-wmf.6/includes/MovePage.php(686): MovePage->moveToInternal(Object(User), Object(Title), '', true, Array)
#9 /srv/mediawiki/php-1.39.0-wmf.6/includes/MovePage.php(498): MovePage->moveUnsafe(Object(User), '', true, Array)
#10 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/moveBatch.php(98): MovePage->move(Object(User), '', true)
#11 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/doMaintenance.php(114): MoveBatch->execute()
#12 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/moveBatch.php(113): require_once('/srv/mediawiki/...')
#13 /srv/mediawiki/multiversion/MWScript.php(116): require_once('/srv/mediawiki/...')
#14 {main}
[36e5025f763bd75b1450fa80] [no req]   Wikimedia\Rdbms\DBTransactionError: Explicit transaction still active; a caller might have failed to call endAtomic() or cancelAtomic().
Backtrace:
from /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1694)
#0 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/loadbalancer/LoadBalancer.php(2223): Wikimedia\Rdbms\LoadBalancer->Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\DatabaseMysqli)
#1 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1729): Wikimedia\Rdbms\LoadBalancer->forEachOpenPrimaryConnection(Closure)
#2 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/lbfactory/LBFactory.php(249): Wikimedia\Rdbms\LoadBalancer->approvePrimaryChanges(array, string, integer)
#3 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(230): Wikimedia\Rdbms\LBFactory::Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\LoadBalancer, string, array)
#4 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/lbfactory/LBFactory.php(251): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure, array)
#5 /srv/mediawiki/php-1.39.0-wmf.6/includes/libs/rdbms/lbfactory/LBFactory.php(310): Wikimedia\Rdbms\LBFactory->forEachLBCallMethod(string, array)
#6 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/includes/Maintenance.php(1270): Wikimedia\Rdbms\LBFactory->commitPrimaryChanges(string)
#7 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/doMaintenance.php(136): Maintenance->shutdown()
#8 /srv/mediawiki/php-1.39.0-wmf.6/maintenance/moveBatch.php(113): require_once(string)
#9 /srv/mediawiki/multiversion/MWScript.php(116): require_once(string)
#10 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 778573 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] maintenance: Don't run unsafe shutdown after crash

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

Change 778573 merged by jenkins-bot:

[mediawiki/core@master] maintenance: Don't run unsafe shutdown after crash

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