Page MenuHomePhabricator

Failed db upgrade from 1.14: Error in fetchObject(): Unknown column 'log_user_text' in 'field list'
Closed, DeclinedPublic

Description

Stepping through the upgrade process from 1.14.0 on the web-ui, I keep ending up on ?page=Upgrade and not being able to continue. The screen that displays has the following error message:

Adding log_user_text field to table logging...ok
Populating log_user_text field, printing progress markers. For large
databases, you may want to hit Ctrl-C and do this manually with
maintenance/populateLogUsertext.php.

An error occured:
Error in fetchObject(): Unknown column 'log_user_text' in 'field list' (localhost)
Backtrace:
#0 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/db/Database.php(3137): DatabaseMysql->fetchObject(Object(ResultWrapper))
#1 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/db/Database.php(3195): ResultWrapper->fetchObject()
#2 /home/mah/work/code/mediawiki/mediawiki-1.17.0/maintenance/populateLogUsertext.php(55): ResultWrapper->next()
#3 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/DatabaseUpdater.php(529): PopulateLogUsertext->execute()
#4 [internal function]: DatabaseUpdater->doLogUsertextPopulation()
#5 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/DatabaseUpdater.php(250): call_user_func_array(Array, Array)
#6 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/DatabaseUpdater.php(218): DatabaseUpdater->runUpdates(Array, false)
#7 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/DatabaseInstaller.php(265): DatabaseUpdater->doUpdates()
#8 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/WebInstallerPage.php(492): DatabaseInstaller->doUpgrade()
#9 /home/mah/work/code/mediawiki/mediawiki-1.17.0/includes/installer/WebInstaller.php(250): WebInstaller_Upgrade->execute()
#10 /home/mah/work/code/mediawiki/mediawiki-1.17.0/mw-config/index.php(46): WebInstaller->execute(Array)
#11 /home/mah/work/code/mediawiki/mediawiki-1.17.0/mw-config/index.php(14): wfInstallerMain()
#12 {main}


Version: 1.17.x
Severity: major

Details

Reference
bz29929

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:32 PM
bzimport set Reference to bz29929.
bzimport added a subscriber: Unknown Object (MLST).

While running maintenance/update.php seems to work somewhat, it fails at a different place:

Making pl_namespace, tl_namespace and il_to indices UNIQUE... A database query syntax error has occurred.
The last attempted database query was:
"DROP INDEX pl_namespace ON pagelinks
"
from within function "DatabaseBase::sourceFile( /home/mah/work/code/mediawiki/mediawiki-1.17.0/maintenance/archives/patch-pl
-tl-il-unique.sql )".
Database returned error "1142: INDEX command denied to user 'wikiuser'@'localhost' for table 'pagelinks' (localhost)"

Executing that command as root to get around the permission problems and then rerunning update.php I ended up with:

A database query syntax error has occurred.
The last attempted database query was:
"ALTER TABLE pagelinks
DROP INDEX pl_namespace,
ADD INDEX pl_namespace(pl_namespace, pl_title, pl_from)
"

This was fixed by removing the "DROP INDEX" bit

Upgrade to 1.17 appears to miss whateveer was in 1.15's AdminSettings.sample. Upgrading to 1.15 first worked.

pierre1807 wrote:

I have the same error while trying to upgrade from 1.10 to 1.17.

(In reply to comment #4)

I have the same error while trying to upgrade from 1.10 to 1.17.

Upgrade to 1.15 first, then. That is the workaround until this is fixed.

(In reply to comment #3)

Upgrade to 1.17 appears to miss whateveer was in 1.15's AdminSettings.sample.
Upgrading to 1.15 first worked.

*.sample files are never loaded....they're samples :)

This is an actual bug since you should be able (in theory) to upgrade directly from any version to trunk w/o hassle. Assigning to myself and raising priority.

(In reply to comment #6)

*.sample files are never loaded....they're samples :)

Sure, but there wasn't even a reference to AdminSettings.php in 1.16 AFAICT. I think I tried 1.14 -> 1.16 and it failed, too.

This is an actual bug since you should be able (in theory) to upgrade directly
from any version to trunk w/o hassle. Assigning to myself and raising priority.

Thank you :)

pierre1807 wrote:

I simply applied maintenance/archives/patch-log_user_text.sql before the upgrade, then "php update.php" worked seamlessly.

Unassigning from Chad, since he's not likely to have time in the near term.

Also see http://lists.wikimedia.org/pipermail/mediawiki-l/2011-April/037107.html
which says:

You can execute
ALTER TABLE logging DROP COLUMN log_user_text;
Then rerun update.php which should now pick that full patch.

I don't think that anybody plans to actively fix this nowadays anymore, hence no high priority anymore?

Decreasing priority to normal, as discussed with hexmode.

Unlikely to be reproducible nowadays.