Page MenuHomePhabricator

Email confirmation broken (user_token is NULL in database)
Closed, ResolvedPublic

Description

i recently updated to Mediawiki 1.25. Now everything works fine, but EmailAuthentication is broken: When a new user creates an account, he receives his confirmation mail, but the confirmation link leads to an error telling the user the token is invalid or expired.

Looking at the database, i notice that the user_email_token, user_email_token_expires and user_email_authenticated columns of the user table are NULL for the newly registered users.

I set up a wgDebugLogFile in LocalSettings.php and saw the following suspicious lines in the log file when creating a new user:

[exception] [ad7904a2] /index.php?title=Spezial:Anmelden&action=submitlogin&type=signup&returnto=Spezial:E-Mail+best%C3%A4tigen/142336d3821c94adb52c80a82fb379c0 MWException from line 3658 of /homepages/26/d447883330/htdocs/wiki/includes/User.php: CAS update failed on user_touched for user ID '825'.
#0 /homepages/26/d447883330/htdocs/wiki/includes/User.php(4165): User->saveSettings()
#1 /homepages/26/d447883330/htdocs/wiki/includes/specials/SpecialUserlogin.php(409): User->sendConfirmationMail()
#2 /homepages/26/d447883330/htdocs/wiki/includes/specials/SpecialUserlogin.php(314): LoginForm->addNewAccount()
#3 /homepages/26/d447883330/htdocs/wiki/includes/specialpage/SpecialPage.php(384): LoginForm->execute(NULL)
#4 /homepages/26/d447883330/htdocs/wiki/includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#5 /homepages/26/d447883330/htdocs/wiki/includes/MediaWiki.php(267): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#6 /homepages/26/d447883330/htdocs/wiki/includes/MediaWiki.php(566): MediaWiki->performRequest()
#7 /homepages/26/d447883330/htdocs/wiki/includes/MediaWiki.php(414): MediaWiki->main()
#8 /homepages/26/d447883330/htdocs/wiki/index.php(41): MediaWiki->run()
#9 {main}
UserMailer::send: sending mail to Testuser3 <**@**.>

Looks like the user is created, but the exception prohibits saving the token and expiry information (at least this is my guess). Can anyone help?

I originally posted this question on the mailing list: https://lists.wikimedia.org/pipermail/mediawiki-l/2015-June/044454.html Other users confirmed the problem: https://lists.wikimedia.org/pipermail/mediawiki-l/2015-June/044455.html
I also posted here because i could not report it in phabricator earlier: https://www.mediawiki.org/wiki/Project:Support_desk#EmailAuthentication_broken_-_token_is_NULL_in_user_table_57772

If any further information is needed, please let me know, as this is my first report here.

Similar error messages: T95839: CAS update failed on user_touched for user ID

Event Timeline

Mrknowitall3 raised the priority of this task from to Needs Triage.
Mrknowitall3 updated the task description. (Show Details)
Mrknowitall3 added subscribers: Mrknowitall3, Klortho.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 18 2015, 9:16 AM
Aklapper triaged this task as High priority.Jun 18 2015, 9:26 AM
Aklapper set Security to None.

Hi, I'm Chris Maloney, the other user mentioned above. I can confirm that the bug happened on 1.25.1, but went away on the same server (http://jatswiki.org/), with the same environment, when I downgraded to 1.24.2.

Krinkle renamed this task from EmailAuthentication broken - token is NULL in user table to Email confirmation broken (user_token is NULL in database).Jun 29 2015, 9:51 AM

I consistently run into the same issue on all third-party wikis running MediaWiki 1.25.1.

I reproduced it locally with REL1_25 checked out. The confirmation link sent on account creation is broken. Using latest master (1.26alpha) the initial link works fine. Reverse git bisect between REL1_25 and master identifies rMW5b4bd1632755: Made User::invalidateCache() use touch() instead of the DB query as the commit that resolves the problem.

Change 221601 had a related patch set uploaded (by Krinkle):
Made User::invalidateCache() use touch() instead of the DB query

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

Change 221601 merged by jenkins-bot:
Made User::invalidateCache() use touch() instead of the DB query

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

We're getting more and more reports of this issue in the support desk. What is the ETA of releasing MediaWiki 1.25.2 with this fix? What are we waiting to make the release?

Florian added a subscriber: Florian.

What is the ETA of releasing MediaWiki 1.25.2 with this fix? What are we waiting to make the release?

@greg / @demon: Do you know / can you tell?

blac added a subscriber: blac.Jul 28 2015, 2:21 PM
Ciencia_Al_Poder closed this task as Resolved.Sep 9 2015, 8:15 PM
Ciencia_Al_Poder assigned this task to Krinkle.

The patch landed on 1.25.2, so marking as resolved