Page MenuHomePhabricator

Nonce already used OAuth errors
Closed, ResolvedPublic

Description

I've seen them very rarely before, but today ~1 out of 50 requests results in a mediawiki API error:

Exception("{u\'info\': u\'The authorization headers in your request are not valid: Nonce already used: 145531318178372694281437064392\', u\'*\': u\'See https://zh.wikipedia.org/w/api.php for API usage\', u\'code\': u\'mwoauth-invalid-authorization\'}",)

crosswatch should catch these and try again.

Event Timeline

Sitic claimed this task.
Sitic raised the priority of this task from to High.
Sitic updated the task description. (Show Details)
Sitic added a project: crosswatch.
Sitic moved this task to In Progress on the crosswatch board.
Sitic subscribed.

The nonce is generated by https://github.com/idan/oauthlib/blob/b934ef52c31ec46db38393e632b42578114d6dbf/oauthlib/common.py#L205 :

return unicode_type(unicode_type(random.getrandbits(64)) + generate_timestamp())

Change 225258 had a related patch set uploaded (by Sitic):
Forward API errors to client, fix error handling

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

Change 225258 merged by Sitic:
Forward API errors to client, fix error handling

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

Was caused by nutcracker and a misleading error message, see T106066.