Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-creation error: Nonce already used #974

Open
mdaniels5757 opened this issue Aug 21, 2024 · 2 comments
Open

Auto-creation error: Nonce already used #974

mdaniels5757 opened this issue Aug 21, 2024 · 2 comments

Comments

@mdaniels5757
Copy link
Contributor

Not sure if this is on our end (possibly due to rapid account creations) or MediaWiki's, but I just got this error in production (request #346825):

mwoauth-invalid-authorization: The authorization headers in your request are not valid: Nonce already used: [nonce redacted by me]

I don't recall getting this one before, but some query like SELECT * FROM jobqueue WHERE status = 'failed' AND error LIKE 'mwoauth-invalid-authorization%'; should make clear whether this is a one-off or not.

It looks like Pywikibot retries when this happens (https://gerrit.wikimedia.org/r/c/pywikibot/core/+/289582), would doing that in our code be desirable? If so, I can make a PR.

@stwalkerster
Copy link
Member

Yeah, IMHO errors of that type can just set the job state back to queued/ready automatically to be picked up on the next run. I'd still appreciate log entries showing the running->failed->queued transition of the job though for full tracking of what went wrong.

I don't recall seeing that error ever pop up before (I'll check later), but I can't remember how we generate nonces to use. We certainly don't keep track of what we've used, we just assume that nonce generation will always give us a unique value.

I'm curious if that failing job was run alongside any other jobs in the batch? Is.it possible we generated the same nonce twice in quick succession, or did we just get unlucky and the stars aligned just right for us to hit a previously-used nonce? I guess we'll never know for sure since we don't store the nonces.

@stwalkerster
Copy link
Member

Job IDs 3030 and 22128 have hit this issue, and the recent one seems to have been the first (of two) job in the batch.

This appears to be a very infrequent issue with minimal impact. I don't think it's something worth spending too much time on but I'm not going to object to a fix appearing in the PR queue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants