Last modified: 2014-06-04 21:36:59 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 T65677, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63677 - Update script is failing midway when updating from 1.18 or earlier to 1.23 due to unknown 'user_password_expires' column
Update script is failing midway when updating from 1.18 or earlier to 1.23 du...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.23rc
All All
: Highest blocker (vote)
: 1.23.0 release
Assigned To: Kevin Israel (PleaseStand)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-08 14:00 UTC by Daniel Vu
Modified: 2014-06-04 21:36 UTC (History)
7 users (show)

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


Attachments

Description Daniel Vu 2014-04-08 14:00:09 UTC
For context, we are in the midst of upgrading our MediaWiki installation from 1.17 to 1.23wmf19. We've tried running the update script from the command line (as well as using the web updater) but keep running into the same error message copy-pasted below:

...batch conversion of user_options: Notice: Undefined property: stdClass::$user_password_expires in [REDACTED]/var/www/html/wiki/includes/User.php on line 1227
A database query error has occurred.
Query: UPDATE  `mw_user` SET user_name = '[REDACTED]',user_password = ':[REDACTED]',user_newpassword = ':[REDACTED]',user_newpass_time = '[REDACTED]',user_real_name = '[REDACTED]',user_email = '[REDACTED]',user_email_authenticated = '[REDACTED]',user_touched = '[REDACTED]',user_token = '[REDACTED]',user_email_token = '[REDACTED]',user_email_token_expires = '[REDACTED]',user_password_expires = NULL WHERE user_id = '1'
Function: User::saveSettings
Error: 1054 Unknown column 'user_password_expires' in 'field list' ([REDACTED IP ADDRESS])
Comment 1 Andre Klapper 2014-04-08 15:00:06 UTC
https://www.mediawiki.org/wiki/Release_notes/1.23 says:
A user_password_expires column has been added to the user table. The User object expects this column to exist. Use update.php to create this new field.

If update.php does not work as expected, please attach its call and output.

Also, do you intentionally run an unstable development version of MediaWiki?
Comment 2 Umherirrender 2014-04-09 16:55:54 UTC
The ConvertUserOptions script is running on the updater.
The script was added there by version 1.19.
So there is a updater problem, when coming from a pre1.19 version to a (at the moment unreleased) version 1.23.
One way to fix this is updating to a version between 1.19 and 1.22 first. Better is fixing the updater. So setting the target milestone to 1.23.

Column was added by Gerrit change #92037.
Comment 3 Bartosz Dziewoński 2014-04-17 20:30:28 UTC
So this is basically about moving  "array( 'addField', 'user', 'user_password_expires', 'patch-user_password_expire.sql' )" before "array( 'doMigrateUserOptions' )" in the updater?
Comment 4 Mark A. Hershberger 2014-05-09 15:55:24 UTC
Sounds like a trivial fix.  I'd like to get it done this week.
Comment 5 Gerrit Notification Bot 2014-05-15 05:32:14 UTC
Change 133411 had a related patch set uploaded by Withoutaname:
Add user_password_expires before running ConvertUserOptions.php

https://gerrit.wikimedia.org/r/133411
Comment 6 Andre Klapper 2014-05-18 09:54:54 UTC
(In reply to Mark A. Hershberger from comment #4)
> Sounds like a trivial fix.  I'd like to get it done this week.

hexmode: 3 liner patch for includes/installer/DatabaseUpdater.php available for review.
Comment 7 Mark A. Hershberger 2014-05-30 11:22:20 UTC
Tests are currently failing on this one.  We'll have to ship with it and fix it in 1.23.1.

Andre, please add a milestone to bugzilla for 1.23.1.
Comment 8 Gerrit Notification Bot 2014-05-30 16:40:16 UTC
Change 136339 had a related patch set uploaded by PleaseStand:
Make convertUserOptions.php more self-contained

https://gerrit.wikimedia.org/r/136339
Comment 9 Chris Steipp 2014-05-30 17:15:03 UTC
I think the way PleaseStand's patch handles this is better than moving the order of the database updates around. If someone can verify the update script works for old wikis, I think we can merge it for 1.23.0.
Comment 10 Markus Glaser 2014-06-02 15:47:46 UTC
The update script works for me both in current REL1_23 and with PleaseStand's patch. In other words, I cannot reproduce the bug. Here's what I did:
* checked out REL1_17
* installed MW
* Modified some user settings
* switched to REL1_23
* ran update.php
It worked in both cases. There was no user_password_expires before, and now there is.
Comment 11 Kevin Israel (PleaseStand) 2014-06-02 15:56:29 UTC
(In reply to Markus Glaser from comment #10)
> The update script works for me both in current REL1_23 and with
> PleaseStand's patch. In other words, I cannot reproduce the bug. Here's what
> I did:
> * checked out REL1_17
> * installed MW
> * Modified some user settings

The bug does exist.

Only 1.15 and earlier would store user preferences in the user_options column. It was 1.16 in which the user_properties table was added; when User::saveSettings() is called in 1.16 - 1.18, user_options is set to the empty string.

The convertUserOptions.php script has a "user_options != ''" condition in the SELECT statement. So no rows would be returned, and the script would not have called User::saveSettings() in your case.
Comment 12 Markus Glaser 2014-06-02 21:06:17 UTC
Thanks PleaseStand. I was able to reproduce the bug with MW1_15 and can confirm your fix resolves the bug.
Comment 13 Gerrit Notification Bot 2014-06-02 22:50:47 UTC
Change 136339 merged by jenkins-bot:
Make convertUserOptions.php more self-contained

https://gerrit.wikimedia.org/r/136339
Comment 14 Gerrit Notification Bot 2014-06-02 22:59:42 UTC
Change 136938 had a related patch set uploaded by Bartosz Dziewoński:
Make convertUserOptions.php more self-contained

https://gerrit.wikimedia.org/r/136938
Comment 15 Gerrit Notification Bot 2014-06-02 23:04:02 UTC
Change 136938 merged by jenkins-bot:
Make convertUserOptions.php more self-contained

https://gerrit.wikimedia.org/r/136938
Comment 16 Andre Klapper 2014-06-04 19:32:30 UTC
Withoutaname: https://gerrit.wikimedia.org/r/#/c/133411/ seems to need rebasing? (That's the only open patch left for this ticket)
Comment 17 Chris Steipp 2014-06-04 19:59:01 UTC
Andre, I think this bug was fixed by https://gerrit.wikimedia.org/r/#/c/136938/ in a better way than Withoutaname's patch.

Since Kevin's patch was merged, I think this bug can be closed?
Comment 18 Bartosz Dziewoński 2014-06-04 21:36:41 UTC
Yes.
Comment 19 Gerrit Notification Bot 2014-06-04 21:36:59 UTC
Change 133411 abandoned by Bartosz Dziewoński:
Updater: Create user_password_expires before doMigrateUserOptions

Reason:
Superseded by https://gerrit.wikimedia.org/r/136339.

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

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


Navigation
Links