-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
"Invalid CSRF token" even after renewal #43
Comments
which version of wikibase-edit are you using? do you know how much time it takes to the token to expire? I can't find it in the documentation |
also, is that part of an intensive edit batch? @jum-s and I have witnessed comparable errors when running a lot of edits |
Sorry, it's complicated. I have been using version 3.0.3. In my case, all edits start to cause this error after it appears the first time. I have seen it happen in less than 2 hours but I'm not sure how long it can take. However, it seems I have been able to patch around this by not using the login cookies but the cookies from the token renewal request (when they appear - they always don't!) In your case, do only some of the edits fail? I think there may be race conditions in the code regarding token renewal: If there are multiple requests in progress while the token expires, doesn't that cause multiple competing renewals which are not in sync with the subsequent retries and new requests? |
To continue about the potential race condition: The fix would be to stop all requests and retries after first error, make one token renewal and only then proceed with the requests and retries with the new token. |
(after some more digging, our case was a bit extreme: we were sending 8000+ parallel POST requests, no wonder the server wasn't keeping up ^^') could you share the code that experiences this error? |
It's a simple NodeJS web service that calls wikibase-edit based on the HTTP requests that it receives. The parameter
|
I have the same error. How did you solve it @tuukka? |
there was quite a lot of changes to the auth code since this issue was open, any chance this issue magically disappeared in the latest version? :D |
Same error on |
@haansn08 could you the error logs? how long did it work before it stopped working? which Wikibase are you working with? |
It still worked on 2020-07-12. I'm using the instance |
trying to address token issues when using username/password: #43
This patch 6abb7d1 might fix the problem (published in |
I use wikibase-edit with password authentication in a NodeJS service. At first everything works fine, but after the CSRF token expires, edits stop working. In the logs, I can see the token renewal operation but after that, Mediawiki still responds "Invalid CSRF token" even for the new token. A restart of the NodeJS service helps until the token expires again.
I see that the cookies don't change after the token renewal - could that be a bug in wikibase-edit or wikibase-token?
The text was updated successfully, but these errors were encountered: