4

I updated a couple of questions with the questions/{id}/edit method and got the following error:

{
    "error_id": 407,
    "error_message": "You cannot perform this action for another 14 seconds",
    "error_name": "write_failed"
}

The response to the previous edit request did not contain a backoff property as described in https://api.stackexchange.com/docs/throttle

Is this a bug?


I can work around this by waiting 4 seconds between edit requests.

  • Probably not a bug as it wasn't the API that was throttling you. It was probably one of the standard "anti spam" limits that apply to all users. ... I think this is a dupe but don't have time to look at the moment. – Brock Adams May 12 '17 at 20:00
  • There is stackapps.com/q/6409/46140 but that's only telling about ... backoff. – cweiske May 12 '17 at 20:02
  • There are often dupes on other sites, mainly MSE and metaSO. – Brock Adams May 12 '17 at 20:03
  • Didn't find any there about write_failed that are relevant. – cweiske May 12 '17 at 20:05
  • Okay. Maybe not a dupe (I know this issue has come up)? Don't have time to do more now. Anywho, not the API that's the limit here. – Brock Adams May 12 '17 at 20:07
1

In the throttle doc you linked to it says:

Every application is subject to an IP based concurrent request throttle. If a single IP is making more than 30 requests a second, new requests will be dropped. The exact ban period is subject to change, but will be on the order of 30 seconds to a few minutes typically.

And it is highly likely that you see the IP throttle in effect and not the dynamic throttle. The IP based throttle is in effect on the HA-Proxy but that article is from 2010 so I assume by now and by my own experience certain routes are more likely to get you IP banned then others. See How many requests are too many? and The Complete Rate-Limiting Guide, specially the explanation about the Chat rate limit, which seems to work similar to the API.

Basically you have to design and code for two throttle cases

  • The IP based throttle, kicks in at will
  • The dynamic throttle, covered by the backoff parameter (assuming you haven't filtered it out)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .