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

Token error when editing #87

Open
ValentinBrclz opened this issue Dec 29, 2015 · 2 comments
Open

Token error when editing #87

ValentinBrclz opened this issue Dec 29, 2015 · 2 comments
Labels
Milestone

Comments

@ValentinBrclz
Copy link
Contributor

Hello,

I often encounter token errors (Error: Invalid token) and after doing some changes to my code, I realised that the error was made because of the concurrency of the requests.

I guess that a token has to be used directly to successfully edit a page. If a second token is asked in the meantime, the edit will fail with the aforementioned error.

Best regards,
Val'

@macbre macbre added the bug label Dec 30, 2015
@macbre macbre added this to the Roadmap milestone Dec 30, 2015
@macbre macbre modified the milestones: Roadmap, v0.11 Jun 4, 2016
@ValentinBrclz
Copy link
Contributor Author

I encountered it again today, errors comes from doEdit.

Error: Edit failed: Error: Error returned by API: Invalid CSRF token.
	at ...\WP-OubliSignature-Bot\node_modules\nodemw\lib\bot.js:514:16
	at Request._callback (...\WP-OubliSignature-Bot\node_modules\nodemw\lib\api.js:219:5)
	at Request.self.callback (...\WP-OubliSignature-Bot\node_modules\request\request.js:186:22)
	at emitTwo (events.js:106:13)
	at Request.emit (events.js:191:7)
	at Request.<anonymous> (...\WP-OubliSignature-Bot\node_modules\request\request.js:1081:10)
	at emitOne (events.js:96:13)
	at Request.emit (events.js:188:7)
	at IncomingMessage.<anonymous> (...\WP-OubliSignature-Bot\node_modules\request\request.js:1001:12)
	at IncomingMessage.g (events.js:291:16)

@macbre macbre modified the milestones: v0.11, v0.12 Aug 25, 2017
@macbre macbre modified the milestones: v0.12, v0.13 Nov 17, 2017
@macbre macbre modified the milestones: v0.13, v0.14 Apr 12, 2020
@macbre macbre modified the milestones: v0.14, v0.15 Jan 22, 2021
@macbre macbre modified the milestones: v0.15, v1.0 Sep 24, 2021
@PaulWieland
Copy link

I believe I am encountering this same error. I'm using nodemw in a NodeRED flow.

I have a global bot object which is refreshed daily.

Then I have another flow which updates the wiki (sometimes thousands of times per day). A small percentage of these updates fail with Error returned by API: Invalid CSRF token, but I'm not quite sure why.

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

No branches or pull requests

3 participants