Page MenuHomePhabricator

Changing the email addresses sends both emails to the old address, none to the new address
Closed, ResolvedPublic

Description

If I change email in preferences then I get no mail at the new address but two at the old.
One is a warning that somebody has changed the email address. This is OK.
The other is the mail with the confirmation link which should have been sent to the new address.
When the link is clicked the old address and not the new is stored in preferences.

The only way the new address can be accepted is apparently to ignore the first confirmation mail and instead request a new. The new one is sent to the new address and the confirmation link stores the new address.

The new address is one that has always worked with Wikipedia mail.
Two other users had the same problem and solution at
https://en.wikipedia.org/w/index.php?title=Wikipedia:Teahouse/Questions&oldid=718411814#Trouble_changing_email_address

Event Timeline

Aklapper renamed this task from ChangeEmail only mails old address to Changing the email addresses sends both emails to the old address, none to the new address.May 3 2016, 1:51 PM
Aklapper added a project: Mail.

This is about Wikipedia and the MediaWiki version running on it, or some external installation of MediaWiki?

I just tested it, at https://en.wikipedia.org/wiki/Special:ChangeEmail and found the same ! Woah! ChangeEmail is broken :(

Mediawiki Version: 1.27.0-wmf.22 (rMW6eefaacfd7f0)
23:28, 2 May 2016

I am not able to reproduce it in my local though!

Aklapper triaged this task as Unbreak Now! priority.May 3 2016, 2:39 PM

I dropped an email to eng@ and ops@ as I'm unsure who could take a look at this and whether it's MW Core or WM server conf territory.

Checked it on http://en.wikipedia.beta.wmflabs.org/wiki/Special:ChangeEmail and via User preferences on beta - all works.
When email address is changed

    • one email is sent to the old email address "Wikipedia registered email address has been changed"
  • the second email (Wikipedia email address confirmation with a link) is sent to the new address
  • after clicking on confirmation link - a user starts receiving emails on the changed address

The diff between master and currently running en.wiki ( wmf/1.27.0-wmf22 )

https://github.com/wikimedia/mediawiki/compare/wmf/1.27.0-wmf.22

After a whole lot of live-hacking to test, it looks like the problem is that CentralAuth isn't using a master instance for some of its hooks that change the database. It's seems likely that it worked until recently thanks to the bug that was fixed in https://gerrit.wikimedia.org/r/#/c/284826/ making it use master anyway.

I'll submit a patch soon that should hopefully fix this.

Change 286926 had a related patch set uploaded (by Anomie):
Use master CentralAuthUser instances when writing

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

After a whole lot of live-hacking to test, it looks like the problem is that CentralAuth isn't using a master instance for some of its hooks that change the database.

Why that's bad: Saving from a slave-loaded instance would work fine the first time, but post-save it reloads the data from a possibly-lagged slave instead of from master so the save isn't actually reflected in the object. Worse, the next save might silently fail thanks to a CAS token mismatch. In my testing here, the ->setEmail() call was suffering from this so the email address wasn't actually being updated.

That looks like the same bug. The underlying problem here is that the ->setEmail() call is failing to properly take effect.

Change 286926 merged by jenkins-bot:
Use master CentralAuthUser instances when writing

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

(Cf. T59583 for setting up artificially lagging database servers in Beta-Cluster-Infrastructure.)

I was seeing strange behavior today where finding the global user for the current local user failed about once per minute, even on wikis with zero unattached users. From the logs, it looked like this always happened at the same time as that user being attached on that wiki, and from reading the code I came to the same conclusion: that the object reloads itself from a slave DB and so the changed state isn't reflected in the object.

Given that this bug is UBN, should we cherry-pick and deploy the patch?

Change 287079 had a related patch set uploaded (by Anomie):
Use master CentralAuthUser instances when writing

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

Given that this bug is UBN, should we cherry-pick and deploy the patch?

I was hoping someone would pick it up for yesterday evening's SWAT, but that doesn't seem to have happened so I'm putting it up for this morning.

Change 287079 merged by jenkins-bot:
Use master CentralAuthUser instances when writing

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

Anomie claimed this task.

Fix is backported to group0 and group1 wikis. group2 will go to 1.27.0-wmf.23 in a few hours (scheduled for 19:00–21:00 UTC), and will be fixed at that time.

Change 287218 had a related patch set uploaded (by Chad):
Use master CentralAuthUser instances when writing

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

Change 287218 merged by jenkins-bot:
Use master CentralAuthUser instances when writing

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

Mentioned in SAL [2016-05-06T14:35:33Z] <demon@tin> Synchronized php-1.27.0-wmf.22/extensions/CentralAuth: Backporting T134246 (duration: 00m 38s)

Change 297574 had a related patch set uploaded (by Gergő Tisza):
Use master CentralAuthUser instances when writing

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

Change 297574 merged by jenkins-bot:
Use master CentralAuthUser instances when writing

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