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.