Page MenuHomePhabricator

"User 'User' exists locally but is not attached." error logged occasionally on registration
Closed, ResolvedPublic

Event Timeline

Tgr created this task.Oct 27 2016, 7:47 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 27 2016, 7:47 PM
Anomie added a subscriber: Anomie.Oct 27 2016, 7:57 PM

Speculation: A race between the CentralAuthCreateLocalAccountJob for loginwiki and the redirect to Special:CentralAuth/start, so the latter somehow sees the local user created but the central user not (or at least not attached).

Tgr added a comment.Oct 27 2016, 8:44 PM

So we'd either need to make SpecialCentralAuth figure out that the user is just in the process of being attached and be more silent (by checking whether the account creation date was within 10s, maybe?), or write lock either the local or the global user record in AuthManager::autoCreateUser so that SpecialCentralAuth is blocked until the attachment finishes.

The second seems more theoretically correct, the first seems way less disruptive though.

Change 318477 had a related patch set uploaded (by Gergő Tisza):
Do not spam logs when the loginwiki user is unattached due to a race

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

Change 318649 had a related patch set uploaded (by Gergő Tisza):
Retry failed centrallogin checks from master

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

Change 318649 merged by jenkins-bot:
Retry failed centrallogin checks from master

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

Change 318477 abandoned by Gergő Tisza:
Do not spam logs when the loginwiki user is unattached due to a race

Reason:
You were right, no errors over the last week.

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

Tgr closed this task as Resolved.Nov 11 2016, 6:40 PM
Tgr claimed this task.

Looks fixed.