Page MenuHomePhabricator

When installer fails, an extra message is shown: Service disabled: DBLoadBalancerFactory while CLI installation failed
Open, NormalPublic

Description

After T46511 resolved, when the CLI installation failed, the script output:

Wikimedia\Services\ServiceDisabledException from line 417 of includes\libs\services\ServiceContainer.php: Service disabled: DBLoadBalancerFactory
Backtrace:
#0 includes\MediaWikiServices.php(563): Wikimedia\Services\ServiceContainer->getService(string)
#1 maintenance\doMaintenance.php(123): MediaWiki\MediaWikiServices->getDBLoadBalancerFactory()
#2 maintenance\install.php(193): require_once(string)
#3 {main}

This is expected. because the installation script will disable all storage layer services at the beginning (via MediaWikiServices::disableStorageBackend() called by Installer::__construct()), if the installation is successful, these services will be restored, but if the installation is not successful, this state will enter this if-block.

# maintenance/doMaintenance.php
if ( $maintenance->getDbType() !== Maintenance::DB_NONE ) {
	// Perform deferred updates.
	$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); // fatal, the service is disabled.
	$lbFactory->commitMasterChanges( $maintClass );
	DeferredUpdates::doUpdates();
}

If the installation fails, we have no need/cannot commit the master changes.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 1 2019, 5:33 PM
RazeSoldier updated the task description. (Show Details)Aug 1 2019, 5:45 PM

Hey there, should this be moved to 1.35? The cut is a couple of weeks away. If it needs to go out in 1.34, is there anything I can do to help get it out of the door?

Hey there, should this be moved to 1.35? The cut is a couple of weeks away. If it needs to go out in 1.34, is there anything I can do to help get it out of the door?

This error has no major impact. It only occurs when the installation fails, but it can cause noise to the end user.

daniel added a subscriber: daniel.Sep 10 2019, 6:25 AM

Hey there, should this be moved to 1.35? The cut is a couple of weeks away. If it needs to go out in 1.34, is there anything I can do to help get it out of the door?

The fix should be trivial, if we can decide on the best approach. Would be nice to get it into 1.34, as it's confusing to the end user. When the installer fails, this generates a lot of noise, suggesting that it is the cause of the problem, while really it's just a side effect.

My suggestion would be to skip the above mentioned block if the storage backend is disabled. Would be nice to issue a warning if there are pending updates that get ignored.

Change 539141 had a related patch set uploaded (by 星耀晨曦; owner: 星耀晨曦):
[mediawiki/core@master] Make sure DBLoadBalancerFactory service is not disabled

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

I am trying to advance this ticket.

This comment was removed by RazeSoldier.
hashar renamed this task from Service disabled: DBLoadBalancerFactory while CLI installation failed to When installer fails, an extra message is shown: Service disabled: DBLoadBalancerFactory while CLI installation failed.Mon, Oct 7, 9:25 AM
hashar triaged this task as Normal priority.