The CentralNotice extension tries to create a special page objects during the initialization of the extension. This, however, requires a database connection to fetch some aliases from the DB. However, for some (especially the localisation ones, like mergeMessageFileList and rebuildLocalisationCache) maintenance scripts, there's no need to have a database conenction available at all. They're also mostly used to prepare a new MediaWiki package before deploying the mediawiki version to the actual system, where it is used for, so no database connection is available.
The goal of this task should be to get rid of the needing a database connection during the setup of the CentralNotice extension. This task is also related to T237148: Allow running rebuildLocalizationCache with Gadgets extension loaded and no DB connection which expresses the same problem in MediaWiki-extensions-Gadgets.
[ada69a06cb8ede40367fea6d] [no req] Wikimedia\Rdbms\DBConnectionError from line 1415 of /tmp/build/6cf687c0/main/includes/libs/rdbms/loadbalancer/LoadBalancer.php: Cannot access the database: Unknown error (localhost) Backtrace: #0 /tmp/build/6cf687c0/main/includes/libs/rdbms/loadbalancer/LoadBalancer.php(932): Wikimedia\Rdbms\LoadBalancer->reportConnectionError() #1 /tmp/build/6cf687c0/main/includes/libs/rdbms/loadbalancer/LoadBalancer.php(899): Wikimedia\Rdbms\LoadBalancer->getServerConnection(integer, string, integer) #2 /tmp/build/6cf687c0/main/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1044): Wikimedia\Rdbms\LoadBalancer->getConnection(integer, array, string, integer) #3 /tmp/build/6cf687c0/main/includes/GlobalFunctions.php(2580): Wikimedia\Rdbms\LoadBalancer->getMaintenanceConnectionRef(integer, array, string) #4 /tmp/build/6cf687c0/main/includes/cache/localisation/LCStoreDB.php(56): wfGetDB(integer) #5 /tmp/build/6cf687c0/main/includes/cache/localisation/LocalisationCache.php(441): LCStoreDB->get(string, string) #6 /tmp/build/6cf687c0/main/includes/cache/localisation/LocalisationCache.php(487): LocalisationCache->isExpired(string) #7 /tmp/build/6cf687c0/main/includes/cache/localisation/LocalisationCache.php(363): LocalisationCache->initLanguage(string) #8 /tmp/build/6cf687c0/main/includes/cache/localisation/LocalisationCache.php(304): LocalisationCache->loadItem(string, string) #9 /tmp/build/6cf687c0/main/languages/Language.php(3112): LocalisationCache->getItem(string, string) #10 /tmp/build/6cf687c0/main/includes/specialpage/SpecialPageFactory.php(693): Language->getSpecialPageAliases() #11 /tmp/build/6cf687c0/main/includes/specialpage/SpecialPage.php(100): MediaWiki\Special\SpecialPageFactory->getLocalNameFor(string, boolean) #12 /tmp/build/6cf687c0/main/includes/specialpage/SpecialPage.php(85): SpecialPage::getTitleValueFor(string, boolean, string) #13 /tmp/build/6cf687c0/main/extensions/CentralNotice/includes/CentralNoticeHooks.php(295): SpecialPage::getTitleFor(string) #14 /tmp/build/6cf687c0/main/includes/Setup.php(883): CentralNoticeHooks::initCentralNotice() #15 /tmp/build/6cf687c0/main/maintenance/doMaintenance.php(83): require_once(string) #16 /tmp/build/6cf687c0/main/maintenance/mergeMessageFileList.php(155): require_once(string) #17 /tmp/build/6cf687c0/mw-config/mw-config/multiversion/MWScript.php(101): require_once(string) #18 {main}