Last modified: 2014-05-08 09:08:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50820, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48820 - Error upgrading MediaWiki from version prior to 1.19 to 1.21: Revision query error during convertUserOptions (missing rev_sha1 column)
Error upgrading MediaWiki from version prior to 1.19 to 1.21: Revision query ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.21.x
All All
: High major with 1 vote (vote)
: 1.21.x release
Assigned To: Nobody - You can work on this!
:
: 49039 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-25 23:52 UTC by Sam Reed (reedy)
Modified: 2014-05-08 09:08 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
mah: Backport_to_Stable+


Attachments
Patch that seems to fix the issue (990 bytes, patch)
2013-05-30 22:42 UTC, David Mudrák
Details

Description Sam Reed (reedy) 2013-05-25 23:52:17 UTC
Reported in IRC. When updating from 1.16 to 1.21

I'm confused as to why it's running a Revision query during convertUserOptions being run.

Both the execution of this script, and the addition of rev_sha1 are both 1.19 activities.

Especially if someone can replicate it via testing, I'd probably just suggest moving the rev_sha1/ar_sha1 additions to the top of the 1.19 section so they'd be already run...

...batch conversion of user_options: A database query syntax error has occurred.
The last attempted database query was:
"SELECT  rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1,page_namespace,page_title,page_id,page_latest,page_is_redirect,page_len,user_name  FROM `revision` INNER JOIN `page` ON ((page_id = rev_page)) LEFT JOIN `user` ON ((rev_user != 0) AND (user_id = rev_user))  WHERE page_id = '1547' AND rev_id = '1807'  LIMIT 1  "
from within function "Revision::fetchFromConds".
Database returned error "1054: Unknown column 'rev_sha1' in 'field list' (10.0.0.48)"
Comment 1 David Mudrák 2013-05-30 22:27:38 UTC
I am able to reproduce this bug while trying to upgrade from REL1_17 to REL1_21. This is the code flow I've been able to track down:

* MysqlUpdater::getCoreUpdateList() declares that 'doMigrateUserOptions' should be executed before adding the field rev_sha1 into the revision table.
* ConvertUserOptions::execute() calls User::saveSettings()
* User::saveSettings() at its very end calls $this->getUserPage()->invalidateCache() and that is where the revision query is joining the party.

I am going to try the suggested fix to move the field addition right before the doMigrateUserOptions step.
Comment 2 David Mudrák 2013-05-30 22:42:06 UTC
Created attachment 12428 [details]
Patch that seems to fix the issue

Attaching bug-48820.patch that seems to fix the issue for me.
Comment 3 Andre Klapper 2013-05-31 11:33:18 UTC
Hi! Thanks for your patch!

You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly.
Thanks again! We appreciate your contribution.
Comment 4 Sam Reed (reedy) 2013-06-01 12:54:16 UTC
*** Bug 49039 has been marked as a duplicate of this bug. ***
Comment 5 Andre Klapper 2013-06-03 08:54:13 UTC
hexmode: Got some time to review this Installer two-liner patch?
Comment 6 Mark A. Hershberger 2013-06-03 17:01:01 UTC
The patch in this bug looks fine to me.  I can test it and apply it if everything else checks out.

I am curious why this has shown up with 1.21 and not earlier releases, though.  There have been a few complaints about it.
Comment 7 David Mudrák 2013-06-03 17:12:06 UTC
For the record, I have actually tried a variant of the patch that moves the addition of both rev_sha1 and ar_sha1 prior to executing doMigrateUserOptions. It worked well, too. I thought that keeping these two additions together would be better as they are related - and the resulting code just looks more consistent and readable.
Comment 8 Gerrit Notification Bot 2013-07-29 13:24:00 UTC
Change 76502 had a related patch set uploaded by Matmarex:
updater: Move rev_sha1 addition before convertUserOptions

https://gerrit.wikimedia.org/r/76502
Comment 9 Platonides 2013-07-29 14:17:08 UTC
There was another report on #mediawiki today http://pastebin.com/YFschha8

However, I'm unable to reproduce the bug.
Comment 10 Gerrit Notification Bot 2013-07-29 14:24:35 UTC
Change 76502 merged by MarkAHershberger:
updater: Move rev_sha1 addition before convertUserOptions

https://gerrit.wikimedia.org/r/76502
Comment 11 Bartosz Dziewoński 2013-07-29 15:31:15 UTC
Patch merged, this will work correctly in MediaWiki 1.22 onward. Now it needs to ba backported to 1.21 and included in a point release.
Comment 12 Gerrit Notification Bot 2013-07-29 21:09:15 UTC
Change 76627 had a related patch set uploaded by MarkAHershberger:
updater: Move rev_sha1 addition before convertUserOptions

https://gerrit.wikimedia.org/r/76627
Comment 13 Gerrit Notification Bot 2013-07-29 21:10:07 UTC
Change 76627 merged by MarkAHershberger:
updater: Move rev_sha1 addition before convertUserOptions

https://gerrit.wikimedia.org/r/76627
Comment 14 Mark A. Hershberger 2013-07-29 21:13:34 UTC
Thanks for the reminder to backport.
Comment 15 Mark A. Hershberger 2013-07-30 16:55:15 UTC
Had a reproduction of the problem while upgrading from 1.16 to 1.21.  I can verify that the patch fixed it.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links