Search API returns 500 Internal Server Error with "code 131"


#1

I’m regularly polling the results of the GET search/tweets API endpoint with lang=en, result_type=recent, count=100, and q=birthday. Basically just getting anything to do with birthdays for the sake of my application having a strong supply of new tweets. The app is checking about every 30 seconds or so, and has successfully pulled in around 4k tweets with no problem, and then suddenly fails a request with a 500 Internal Server Error, with this response:

{"errors":[{"message":"Internal error","code":131}]}

I’ve been poking around as best I can, and added a request to the GET application/rate_limit_status API endpoint as a troubleshooting step. I’ll post again if I have more info.


#2

I submitted this as an issue a couple of weeks ago:
https://dev.twitter.com/issues/788

I found that upon getting this error if I re-submit the request I get a good response. That’s my temporary fix.


#3

Finally back at work, and… yep, seems it works as a band-aid for me as well. I ended up implementing both the retry as @boxnumber03 suggested, and a check to the rate_limit_status endpoint as a second connection retry, postponing the “something broke” emails that go out to my team until at least after the initial retry.

Anyone know if this internal error is something we should expect to keep seeing, or what?