Page MenuHomePhabricator

Mitigate broken login due to Nonce already used
Closed, ResolvedPublic

Description

Due to T272319: Frequent "Nonce already used" errors in scripts and tools, login is broken sometimes (happened 50 times over 700 logins). Automatic retry may be performed to avoid showing error to the user.

(4 additional frame(s) were not displayed)
  File "flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "quarry/web/login.py", line 34, in login
    redirect_url, request_token = handshaker.initiate()
  File "mwoauth/handshaker.py", line 89, in initiate
    user_agent=self.user_agent)
  File "mwoauth/functions.py", line 98, in initiate
    "{0}".format(repr(r.content)))
OAuthException: Expected x-www-form-urlencoded response from MediaWiki, but got something else: b'Error: An error occurred in the OAuth protocol: Nonce already used: 873230511213254369'

See also patch on another tool: R2362:23ccbcf6f670: Work around MediaWiki “Nonce already used” errors

Event Timeline

Change 665472 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[analytics/quarry/web@master] Mitigate broken login due to Nonce already used

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

Mentioned in SAL (#wikimedia-cloud) [2021-02-20T13:18:16Z] <wm-bot> framawiki: Deployed f51f9a9 on -web-01 T275277 (not yet merged)

Change 665472 abandoned by Framawiki:

[analytics/quarry/web@master] Mitigate broken login due to Nonce already used

Reason:

T272319, upstream issue, was closed

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