Page MenuHomePhabricator

Unexpected ratelimit makes Pywikibot crash
Open, LowPublic

Description

Due to the hack done in T184948 Pywikibot crashed with this nice error.

pywikibot.data.api.APIError: failed-save: The save has failed. [help:See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.; messages:[{'name': 'wikibase-api-failed-save', 'parameters': [], 'html': {'*': 'The save has failed.'}}, {'name': 'actionthrottledtext', 'parameters': [], 'html': {'*': 'As an anti-abuse measure, you are limited from performing this action too many times in a short space of time, and you have exceeded this limit.\nPlease try again in a few minutes.'}}]]
<class 'pywikibot.data.api.APIError'>
CRITICAL: Closing network session.

Same hack also broke massmessage, see T192690. The hack was removed so the chance of someone running into this is much lower.

Pywikibot should be updated so that a throttle error is a recoverable error. So the usual logic should kick in: Wait a bit, try again.

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptApr 24 2018, 2:03 PM
Multichill triaged this task as High priority.Apr 24 2018, 2:04 PM
Vvjjkkii renamed this task from Unexpected ratelimit makes Pywikibot crash to nceaaaaaaa.Jul 1 2018, 1:14 AM
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Mainframe98 renamed this task from nceaaaaaaa to Unexpected ratelimit makes Pywikibot crash.Jul 1 2018, 7:36 AM
Mainframe98 updated the task description. (Show Details)
Mainframe98 added a subscriber: Aklapper.
Xqt added a subscriber: Xqt.Jul 15 2018, 4:58 PM

Cannot follow this task. Pywikibot is throttleling not to edit more than 6 (I guess) pages per minute by default. What might be the reason that the limit of 40 pages is exceeded. What was the putthrottle setting when the exception occurred?

@Multichill is the error still given ? I've read somewhere that this hacky limitation was removed from wd.org

Multichill lowered the priority of this task from High to Low.Sep 2 2018, 11:55 AM

@Multichill is the error still given ? I've read somewhere that this hacky limitation was removed from wd.org

Yes and no. The ratelimit was removed again I think so we won't run into it. I changed the prio from high to low. Pywikibot should be updated that if the bot for whatever reason runs into a ratelimit error, it should be handled as a recoverable error. I'll update the task

@Xqt flagged bots on Wikidata usually edit a bit faster than one edits every six seconds, most of my bots are one edit every two seconds.

Multichill updated the task description. (Show Details)Sep 2 2018, 11:58 AM
Framawiki updated the task description. (Show Details)Sep 2 2018, 5:04 PM