Page MenuHomePhabricator

Unable to run ttmserver-export.php: Container disabled!
Open, Needs TriagePublic

Description

Wikimedia\Services\ContainerDisabledException from line 411 of /srv/mediawiki/workdir/vendor/wikimedia/services/src/ServiceContainer.php: Container disabled!
#0 /srv/mediawiki/workdir/includes/MediaWikiServices.php(301): Wikimedia\Services\ServiceContainer->getService()
#1 /srv/mediawiki/workdir/vendor/wikimedia/services/src/ServiceContainer.php(427): MediaWiki\MediaWikiServices->getService()
#2 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(211): Wikimedia\Services\ServiceContainer->get()
#3 /srv/mediawiki/workdir/vendor/wikimedia/object-factory/src/ObjectFactory.php(152): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec()
#4 /srv/mediawiki/workdir/includes/session/SessionManager.php(472): Wikimedia\ObjectFactory\ObjectFactory->createObject()
#5 /srv/mediawiki/workdir/includes/session/SessionManager.php(531): MediaWiki\Session\SessionManager->getProviders()
#6 /srv/mediawiki/workdir/includes/session/SessionManager.php(254): MediaWiki\Session\SessionManager->getSessionInfoForRequest()
#7 /srv/mediawiki/workdir/includes/WebRequest.php(842): MediaWiki\Session\SessionManager->getSessionForRequest()
#8 /srv/mediawiki/workdir/includes/user/User.php(1116): WebRequest->getSession()
#9 /srv/mediawiki/workdir/includes/user/User.php(439): User->loadFromSession()
#10 /srv/mediawiki/workdir/includes/user/User.php(1903): User->load()
#11 /srv/mediawiki/workdir/includes/user/User.php(2548): User->getId()
#12 /srv/mediawiki/workdir/includes/user/UserOptionsManager.php(645): User->isRegistered()
#13 /srv/mediawiki/workdir/includes/user/UserOptionsManager.php(497): MediaWiki\User\UserOptionsManager->getCacheKey()
#14 /srv/mediawiki/workdir/includes/user/UserOptionsManager.php(148): MediaWiki\User\UserOptionsManager->loadUserOptions()
#15 /srv/mediawiki/workdir/includes/context/RequestContext.php(453): MediaWiki\User\UserOptionsManager->getOption()
#16 /srv/mediawiki/workdir/includes/StubUserLang.php(34): RequestContext->getLanguage()
#17 /srv/mediawiki/workdir/includes/StubObject.php(223): StubUserLang->_newObject()
#18 /srv/mediawiki/workdir/includes/StubObject.php(103): StubObject->_unstub()
#19 /srv/mediawiki/workdir/includes/content/ContentHandler.php(739): StubObject::unstub()
#20 /srv/mediawiki/workdir/includes/Title.php(3972): ContentHandler->getPageLanguage()
#21 /srv/mediawiki/workdir/extensions/Translate/messagegroups/WikiPageMessageGroup.php(37): Title->getPageLanguage()
#22 /srv/mediawiki/workdir/extensions/Translate/scripts/ttmserver-export.php(201): WikiPageMessageGroup->getSourceLanguage()
#23 /srv/mediawiki/workdir/extensions/Translate/scripts/ttmserver-export.php(126): TTMServerBootstrap->exportGroup()
#24 /srv/mediawiki/workdir/maintenance/doMaintenance.php(114): TTMServerBootstrap->execute()
#25 /srv/mediawiki/workdir/extensions/Translate/scripts/ttmserver-export.php(307): require_once('/srv/mediawiki/...')
#26 {main}

Per my debugging, ttmserver-export.php calls MediaWiki\MediaWikiServices::resetChildProcessServices() after forking. However, SessionManager (which is constructed unconditionally before TTMServerBootstrap::execute) stores a reference to ObjectFactory in a member variable. The ObjectFactory stores a reference to the service container, which has been destroyed.

I am marking this as UBN! because we need to run this script this week, preferably on Wednesday, on translatewiki.net to unblock the search platform team with elasticsearch upgrades.

It's possible this is indirectly the root cause for T306743: Container Disabled! (JobQueue/RefreshLinksJob/Parser::getTargetLanguageConverter) and T306707: Container disabled! (JobQueue/MessageUpdateJob/PageUpdater/WikitextContentHandler/Parser/MWTimestamp/Message) where @Func already pointed to T265400: Research to create service for SessionManager::singleton()/getGlobalSession()

Event Timeline

Change 790665 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Create SessionManager service

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

Maybe as a UBN fix we can stop storing an ObjectFactory instance and just fetch a new one every time ->getProviders() is called.

Change 792217 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/core@master] SessionManager: stop storing an ObjectFactory instance

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

Change 792217 merged by jenkins-bot:

[mediawiki/core@master] SessionManager: stop storing an ObjectFactory instance

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

Nikerabbit lowered the priority of this task from Unbreak Now! to Needs Triage.May 17 2022, 8:59 AM

Thanks. Based on my testing we are unblocked now.

Change 792479 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/core@REL1_38] SessionManager: stop storing an ObjectFactory instance

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

Change 792479 merged by jenkins-bot:

[mediawiki/core@REL1_38] SessionManager: stop storing an ObjectFactory instance

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