Page MenuHomePhabricator

TypeError: Argument 5 passed to Wikimedia\Rdbms\MaintainableDBConnRef::sourceFile() must be callable or null, array given, called in /srv/mediawiki/w/includes/installer/DatabaseUpdater.php on line 648
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • run sudo -u www-data php /srv/mediawiki/w/maintenance/update.php --schema /home/you/file.sql --wiki=yourwiki
  • see failure at end

What happens?:
Gives

...skipping schema change (Modifying chd_seen field of table wb_changes_dispatch).
Modifying page_restrictions field of table page ...[d487951ac0dbd7e2bb25ee24] [no req]   TypeError: Argument 5 passed to Wikimedia\Rdbms\MaintainableDBConnRef::sourceFile() must be callable or null, array given, called in /srv/mediawiki/w/includes/installer/DatabaseUpdater.php on line 648
Backtrace:
from /srv/mediawiki/w/includes/libs/rdbms/database/MaintainableDBConnRef.php(26)
#0 /srv/mediawiki/w/includes/installer/DatabaseUpdater.php(648): Wikimedia\Rdbms\MaintainableDBConnRef->sourceFile(string, NULL, NULL, string, array)
#1 /srv/mediawiki/w/includes/installer/DatabaseUpdater.php(700): DatabaseUpdater->copyFile(string)
#2 /srv/mediawiki/w/includes/installer/DatabaseUpdater.php(1017): DatabaseUpdater->applyPatch(string, boolean, string)
#3 /srv/mediawiki/w/includes/installer/DatabaseUpdater.php(464): DatabaseUpdater->modifyField(string, string, string)
#4 /srv/mediawiki/w/includes/installer/DatabaseUpdater.php(510): DatabaseUpdater->writeSchemaUpdateFile()
#5 /srv/mediawiki/w/maintenance/update.php(193): DatabaseUpdater->doUpdates(array)
#6 /srv/mediawiki/w/maintenance/doMaintenance.php(112): UpdateMediaWiki->execute()
#7 /srv/mediawiki/w/maintenance/update.php(264): require_once(string)
#8 {main}

What should have happened instead?:
No error, should generate file.sql with changes

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Product Version
MediaWiki 1.36.2 (38acf86)
17:15, 11 October 2021
PHP 7.4.21 (fpm-fcgi)
MariaDB 10.4.15-MariaDB-1:10.4.15+maria~buster-log
ICU 67.1
LuaSandbox 3.0.3
Lua 5.1.5

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 730185 had a related patch set uploaded (by Paladox; author: Paladox):

[mediawiki/core@master] DatabaseUpdater: Fix 5th param in sourceFile

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

Reedy subscribed.

Has this really been broken since it was implemented in rMW34c9bca6a800: (bug 38110) provide a way to separate out schema changes for T40110: Upgrades should provide a way to separate out schema changes for environments that need it...

I guess it's possible, as it's a not very well used code path... It does look like this is the only usage of the callbacks... And AFAIK, this is how we call them in other places?

https://www.php.net/manual/en/language.types.callable.php

Change 730245 had a related patch set uploaded (by Krinkle; author: Paladox):

[mediawiki/core@REL1_37] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730366 had a related patch set uploaded (by Krinkle; author: Paladox):

[mediawiki/core@REL1_36] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730367 had a related patch set uploaded (by Krinkle; author: Paladox):

[mediawiki/core@REL1_35] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730367 merged by jenkins-bot:

[mediawiki/core@REL1_35] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730245 merged by jenkins-bot:

[mediawiki/core@REL1_37] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730366 merged by jenkins-bot:

[mediawiki/core@REL1_36] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Change 730185 merged by jenkins-bot:

[mediawiki/core@master] installer: Fix 5th param to sourceFile() in DatabaseUpdater

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

Travor set the point value for this task to 7.Oct 17 2021, 7:30 AM
Travor set Final Story Points to 7.
Reedy removed the point value for this task.Oct 18 2021, 10:55 PM
Reedy assigned this task to Paladox.