502 Bad Gateway when trying to retrieve /1/statuses/mentions.json

86 views
Skip to first unread message

Miguel de Icaza

unread,
Jan 7, 2011, 5:56:35 PM1/7/11
to twitter-deve...@googlegroups.com
Hello folks,

    My twitter client (TweetStation for the iPhone) broke during the holidays as twitter now sends me back a 502 Bad Gateway error when I post the following:

GET /1/statuses/mentions.json?count=200 HTTP/1.1
authorization: [My Oauth goes here]

    I am doing this over HTTP, not HTTPS, would that make a difference?

Miguel

Taylor Singletary

unread,
Jan 7, 2011, 6:03:06 PM1/7/11
to twitter-deve...@googlegroups.com
This error usually occurs when it takes longer than a certain amount of allotted time to serve the request. 

While I'd prefer it if we could serve 200 tweets at a time on a mentions timeline consistently without throwing a 502 (the time will indeed come), you are likely to get better, more consistently successful results by asking for a lower count value. Alternately, if you receive a 502 as a response to a request, wait a few seconds and then retry the request -- more often than not the first attempt will warm the cache up for you, readying the data for the subsequent request.

Taylor

--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

Miguel de Icaza

unread,
Jan 7, 2011, 6:18:44 PM1/7/11
to twitter-deve...@googlegroups.com
That explains it.

I stopped using my phone during the holiday break, and after that, nothing worked.

I typically send the mentions.json with the count, since_id and max_id parameters, but over the holidays that accumulated and started returning errors.   I heard about this problem first from a friend that has been traveling around the world and not using twitter very much and he complained about the same problem.

Is this a temporary problem that you guys are working on, or is the recommended practice to do client-side looping?

And could we get this documented on the API pages?

Miguel.
Reply all
Reply to author
Forward
0 new messages