Error
- mwversion: 1.44.0-wmf.19
- reqId: 443ead3a-df44-43fa-b101-1087183fa974
- Find reqId in Logstash
[{reqId}] {exception_url} LogicException: CentralAuthReturnRequest not found| Reedy | |
| Mar 7 2025, 4:07 PM |
| F58910868: Screenshot Capture - 2025-03-24 - 18-56-59.png | |
| Mar 24 2025, 6:00 PM |
| F58910870: Screenshot Capture - 2025-03-24 - 18-58-12.png | |
| Mar 24 2025, 6:00 PM |
[{reqId}] {exception_url} LogicException: CentralAuthReturnRequest not foundThis seems weird - the URL is /wiki/Special:UserLogin and it must be a POST request since otherwise the code path that leads to continuePrimaryAuthentication() wouldn't be active, but the referrer is https://commons.m.wikimedia.org/wiki/Special:ConfirmEmail/517c09033f0a5ce67a12cdeacc68acc1. How is that even possible?
CentralAuthRedirectingPrimaryAuthenticationProvider::beginPrimaryAuthentication() returns a response with a CentralAuthReturnRequest object in it, in theory that means the following continuePrimaryAuthentication() call should also have that object. But maybe if the corresponding GET/POST parameter is missing, we automatically skip adding the object? I thought that would only happen to AuthenticationRequest objects where $required is set to OPTIONAL, but maybe I'm misremembering.
So I suspect this is some kind of manual request tampering, but in theory the LogicException should not be reachable, and if it is reachable, we need a proper StatusValue-based error instead.
This seems really weird, vaguely following the Special:ConfirmEmail code, I see that it sometimes call Special:UserLogin as a GET request. I think maybe this is when we some weird behavior when cookies on shared domain are set but not on local domain (when continueAuthentication is called) - maybe some timeout(?). Then that throws the logic error but I wonder why/when that should ever happen.
But nevertheless, I'll try to reproduce it and see.
I guess what's happening is:
We should probably use a query parameter to ensure that the special /return processing only happens on the same redirect chain, and not in an unrelated browser window.
There's also a bunch of Validation error on return logstash entries, which I imagine is a side effect of this, but we'll need to double-check that.
Change #1128039 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):
[mediawiki/core@master] authmanager: Use an URL parameter to keep track of returns
Change #1128039 merged by jenkins-bot:
[mediawiki/core@master] authmanager: Use an URL parameter to keep track of returns
Change #1130320 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):
[mediawiki/core@wmf/1.44.0-wmf.21] authmanager: Use an URL parameter to keep track of returns
Change #1130320 merged by jenkins-bot:
[mediawiki/core@wmf/1.44.0-wmf.21] authmanager: Use an URL parameter to keep track of returns
Mentioned in SAL (#wikimedia-operations) [2025-03-24T08:48:31Z] <tgr@deploy1003> Started scap sync-world: Backport for [[gerrit:1130320|authmanager: Use an URL parameter to keep track of returns (T388250)]]
Mentioned in SAL (#wikimedia-operations) [2025-03-24T08:54:01Z] <tgr@deploy1003> tgr: Backport for [[gerrit:1130320|authmanager: Use an URL parameter to keep track of returns (T388250)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)
Mentioned in SAL (#wikimedia-operations) [2025-03-24T09:04:49Z] <tgr@deploy1003> Finished scap sync-world: Backport for [[gerrit:1130320|authmanager: Use an URL parameter to keep track of returns (T388250)]] (duration: 16m 18s)
Errors are gone:
| Validation error on return | LogicException: CentralAuthReturnRequest not found |
Doesn't seem to have been replaced by new errors either.