Previously we loaded the extension by including ContributionTracking.php which points the database to the master:
$wgContributionTrackingDBserver = $wgDBserver; $wgContributionTrackingDBname = $wgDBname; $wgContributionTrackingDBuser = $wgDBuser; $wgContributionTrackingDBpassword = $wgDBpassword;
With extension registration (wfLoadExtension( 'ContributionTracking' ) from T87903) the PHP file is not processed and the four variables are NULL.
The LoadExtensionSchemaUpdates hook eventually invokes:
static function contributionTrackingConnection() { global $wgContributionTrackingDBserver, $wgContributionTrackingDBname; global $wgContributionTrackingDBuser, $wgContributionTrackingDBpassword; global $wgDBserver, $wgDBname; static $db; if ( !$db ) { if ( $wgContributionTrackingDBserver === $wgDBserver && $wgContributionTrackingDBname === $wgDBname ) { $db = wfGetDB( DB_MASTER ); } else { $params = [ 'host' => $wgContributionTrackingDBserver, 'user' => $wgContributionTrackingDBuser, 'password' => $wgContributionTrackingDBpassword, 'dbname' => $wgContributionTrackingDBname ]; $db = Database::factory( 'mysql', $params ); } } return $db; }
Since $wgContributionTrackingDBserver and $wgContributionTrackingDBname are NULL, the DB_MASTER is not retrieved. The code then attempts to create a MySQL database using NULL host/user/password/dbname:
Creating tables for enabled extensions $wgContributionTrackingDBserver = NULL $wgContributionTrackingDBname = NULL [no req] InvalidArgumentException from line 374 of includes/libs/rdbms/database/Database.php: No database user provided. Backtrace: #0 includes/libs/rdbms/database/Database.php(350): Wikimedia\Rdbms\Database->doInitConnection() #1 includes/libs/rdbms/database/Database.php(463): Wikimedia\Rdbms\Database->initConnection() #2 extensions/ContributionTracking/ContributionTracking.processor.php(44): Wikimedia\Rdbms\Database::factory(string, array) #3 extensions/ContributionTracking/ContributionTracking.hooks.php(57): ContributionTrackingProcessor::contributionTrackingConnection() #4 includes/Hooks.php(174): ContributionTrackingHooks::onLoadExtensionSchemaUpdates(SqliteUpdater) #5 includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL) #6 includes/installer/DatabaseUpdater.php(127): Hooks::run(string, array) #7 includes/installer/DatabaseUpdater.php(192): DatabaseUpdater->__construct(Wikimedia\Rdbms\DatabaseSqlite, boolean, NULL) #8 includes/installer/DatabaseInstaller.php(312): DatabaseUpdater::newForDB(Wikimedia\Rdbms\DatabaseSqlite) #9 includes/installer/Installer.php(1567): DatabaseInstaller->createExtensionTables(SqliteInstaller) #10 includes/installer/CliInstaller.php(138): Installer->performInstallation(array, array) #11 maintenance/install.php(125): CliInstaller->execute() #12 maintenance/doMaintenance.php(94): CommandLineInstaller->execute() #13 maintenance/install.php(175): require_once(string) #14 {main}