한국   대만   중국   일본 
? T236671 Misleading message on update when database is entirely missing: "Missing rc_timestamp field of recentchanges table"
Page Menu Home Phabricator

Misleading message on update when database is entirely missing: "Missing rc_timestamp field of recentchanges table"
Closed, Resolved Public

Description

When trying to upgrade a mediawiki from 1.27 to 1.33.1 i got the following error message:

MWException from line 463 of /var/www/mediawiki/code/includes/installer/MysqlUpdater.php: Missing rc_timestamp field of recentchanges table. Should not happen.

This is totally misleading. In my case the whole database was missing and I'd expect the updater to say so.

Event Timeline

Aklapper renamed this task from Misleadging message on update: MWException from line 463 of /var/www/mediawiki/code/includes/installer/MysqlUpdater.php: Missing rc_timestamp field of recentchanges table. Should not happen. to Misleading message on update when database is missing . Oct 28 2019, 2:11 PM
Aklapper updated the task description. (Show Details)

Happened again today unfortunately a google search did not lead me here.

Aklapper renamed this task from Misleading message on update when database is missing to Misleading message on update when database is entirely missing: "Missing rc_timestamp field of recentchanges table" . Mar 16 2020, 1:51 PM

Three years later, Google finally also pointed to this issue.

I just had senior moments, too, and tried to update a non-existing database:

me@server:/../w$ php maintenance/update.php --quick
MediaWiki 1.31.16 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for databasename
Depending on the size of your database this may take a while!
Turning off Content Handler DB fields for this part of upgrade.
...ipblocks table does not exist, skipping new field patch.
...ipblocks table does not exist, skipping new field patch.
...already have interwiki table
[e8a98e8f613ac7f0e1cbabc8] [no req]   MWException from line 454 of /../w/includes/installer/MysqlUpdater.php: Missing rc_timestamp field of recentchanges table. Should not happen.
Backtrace:
#0 /../w/includes/installer/DatabaseUpdater.php(482): MysqlUpdater->doIndexUpdate()
#1 /../w/includes/installer/DatabaseUpdater.php(446): DatabaseUpdater->runUpdates()
#2 /../w/maintenance/update.php(203): DatabaseUpdater->doUpdates()
#3 /../w/maintenance/doMaintenance.php(94): UpdateMediaWiki->execute()
#4 /../w/maintenance/update.php(248): require_once(string)
#5 {main}

The error is indeed misleading. It will be nice for update.php to check if the database exists before it starts running. Newer versions of MediaWiki may perhaps already do this. This, however, does not help us with ante-diluvial versions of MediaWiki we somehow try to upgrade to a decently recent version.

@Aklapper It would be fantastic if you could get somebody from the database team just to comment if such a check already exists in newer versions of MediaWiki. If not, it will also be nice to get an assessment if it is feasible to have the check, thus making this a feature request. Thanks a ton.

@Kghbln : That sounds like a good question for the wikitech-l mailing list

The relevant code was removed in 1.36. For me on git master, I see a more helpful error message.

Kghbln claimed this task.

Thanks a bunch for the feedback. I assume this issue can be closed now.