Page MenuHomePhabricator

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

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.Oct 7 2019, 9:25 AM
hashar triaged this task as Medium priority.
Krinkle removed RazeSoldier as the assignee of this task.EditedNov 6 2019, 12:49 AM
Krinkle added a project: Core Platform Team.
Krinkle added a subscriber: Krinkle.

[mediawiki/core@master] Make sure DBLoadBalancerFactory service is not disabled

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

This patch is nominated for 1.34 but requires code review. Given involvement from Daniel and CPT's previous interest in the installer, tagging CPT for possible CR.

I'll leave it for another time to ask whether this should be made official on mw:Maintainers so that these aren't unattended for so long in the future. (That is, to make official that CPT is or is not the steward, so that if not, we can start looking for a steward elsewhere in the org).

Change 539141 merged by jenkins-bot:
[mediawiki/core@master] Make sure DBLoadBalancerFactory service is not disabled

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

Anomie closed this task as Resolved.Nov 6 2019, 4:49 PM
Anomie assigned this task to RazeSoldier.
Anomie added a subscriber: Anomie.

(still needs backport to 1.34 though)

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

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

RazeSoldier reopened this task as Open.Nov 20 2019, 4:20 PM

Reopen as a backport patch haven't not merge yet .

Reedy closed this task as Resolved.Dec 1 2019, 6:01 PM
Reedy removed a project: Patch-For-Review.
Reedy added a subscriber: Reedy.

Merged (well, C+2'd). Will do RELEASE-NOTES in separate commit tidying up

Change 549117 merged by jenkins-bot:
[mediawiki/core@REL1_34] Make sure DBLoadBalancerFactory service is not disabled

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