Page MenuHomePhabricator

Autologin always fails the first time when the local account on the wiki does not exist
Closed, ResolvedPublic

Description

When you log in on one wiki, then visit another wiki that you've never visited before, the autologin mechanism (whether via resource or top-level) is supposed to create a local account, attach it, then log into it – instead, the account is created and attached, but the login fails with error message "Local user is not attached". The next time autologin is attempted, the account exists, so it works. This could be some sort of a race condition.

I ran into this by chance today while testing a CentralAuth backport. We actually have error logging for the top-level fails, and this happens ~200 times per day: https://logstash.wikimedia.org/goto/6c27772466efa52122ec691c605c05a6

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 968005 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] autologin: Reload central user after successful autocreation

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

Change 968005 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] autologin: Reload central user after successful autocreation

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

(We should check the error logs next week to confirm)

The group2 train was deployed at 18:22, the last error log is from 18:05 (before we had something like 5 errors per hour) so I think we are good.