HTTP error 400 with Twitter Rev 61

Bug #199453 reported by Todd Slater
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Gwibber
Won't Fix
Undecided
Ryan Paul

Bug Description

Gwibber won't fetch twitter updates, nor jaiku. If you disable receiving from twitter, however, it will fetch jaiku. It gives a 400 error, bad request.

todd@tantalus:~/gwibber/trunk$ ./run
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 460, in __bootstrap
    self.run()
  File "threading.py", line 440, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/todd/gwibber/trunk/gwibber/client.py", line 496, in process
    self.data = list(self.generate_message_list())
  File "/home/todd/gwibber/trunk/gwibber/client.py", line 464, in generate_message_list
    for message in client.get_messages():
  File "/home/todd/gwibber/trunk/gwibber/twitter.py", line 67, in get_messages
    for data in self.get_data():
  File "/home/todd/gwibber/trunk/gwibber/twitter.py", line 64, in get_data
    "http://twitter.com/statuses/friends_timeline.json"))
  File "/home/todd/gwibber/trunk/gwibber/twitter.py", line 60, in connect
    url, data, {"Authorization": self.get_auth()})).read()
  File "urllib2.py", line 124, in urlopen
    return _opener.open(url, data)
  File "urllib2.py", line 387, in open
    response = meth(req, response)
  File "urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
  File "urllib2.py", line 425, in error
    return self._call_chain(*args)
  File "urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request

Revision history for this message
Ryan Paul (segphault) wrote :

Twitter typically returns an HTTP 400 error when a user exceeds the rate limit for refreshes. I think the current limit is 70 requests in a 60 minute time period. Try disabling Twitter refreshes for a while and see if it works again later.

This report encompasses two issues. The first issue is obviously that Gwibber needs to provide an appropriate notification to the user rather than just dumping the error message to the console and hanging. I'll probably create a separate bug report for that myself because that's a problem that is broader than just HTTP 400 errors.

The second issue, which we can address in this bug report, is that Gwibber should make it impossible for users to exceed the rate limit. I've more or less tried to do that by making the preference dialog minimum setting one refresh per minute. If Gwibber is doing more than that, it's definitely a bug.

Were you perhaps running two instances of the client at once? Or were you running a second client simultaneously at the same time? Or performing lots of additional refresh operations? Also, what is your current interval setting?

If there are no external conditions that could potentially be responsible, I think the problem would mostly likely be a glitch with the way that the timer is implemented. If you can rule out the external conditions, I'll add some extra debug code to make it easier to track/visualize refreshes and that might provide some insight into whether or not there are runaway timer problems.

Thanks! Sorry for the long comment, it's mostly so I will remember all of this later. ;-)

Changed in gwibber:
assignee: nobody → segphault
Revision history for this message
Todd Slater (dontodd) wrote :

I don't believe I had any other instances of gwibber or any other twitter clients running simultaneously. I had closed and reopened gwibber a few times when it wasn't displaying any posts, but I'm pretty sure all the processes got killed when I closed it. I have my refresh set at 5 minutes.

Another issue is that the twitter error seems to have prevented jaiku updates, so if one service fails the others should not, obviously.

I was wondering if the problem might have been twitter to begin with and not gwibber at all. I don't know how to test that, though, the extent of my knowledge is to go to http://www.istwitterdown.com/ ;)

Thanks for the help!

Revision history for this message
Ryan Paul (segphault) wrote :

The Twitter failure preventing Jaiku updates is definitely a big problem. I'll make a separate bug for that and make it a high priority. I'll try to put in at least some kind of temporary fix for that later today.

Thanks for helping me rule out the possibility of another client instance. It could be a bug with Twitter itself, but I'm not seeing anything like that here. Is it still happening consistently, or was it just temporary? I think I'll put in some debug code later today so we can track it more closely.

Thanks!

Changed in gwibber:
status: New → Confirmed
Revision history for this message
Ryan Paul (segphault) wrote :

There don't seem to be any timer bugs and nobody else seems to be seeing these problems, so I'm going to close this report for now. If you happen to encounter this problem again or it is still happening to you consistently, please feel free to reopen and I'll look at it again.

Changed in gwibber:
status: Confirmed → Won't Fix
Revision history for this message
Jason Ryan (jason-miromiro) wrote :

I'm wondering if this is related to the issue I posted about in answers:

https://answers.launchpad.net/gwibber/+question/44224

Same symptoms, only the error I get is 401: Unauthorized.

I have tried all sorts of solutions (deleting & recreating the account, changing my password, etc.) & I can't get Gwibber to retrieve any messages...

I am pretty sure it is not related to the number of requests as I have disabled the client on my work machine for 48 hours, & still no luck...

Thanks

Revision history for this message
Lane Lester (llester) wrote :

I got the 400 errors from Twitter this morning when I first started Gwibber. After a while I ran Twitux, and the Twitter posts started showing right away, after I clicked "Connect." Gwibber's interface is much more attractive, so I hope this will be fixed.

On a side issue, I like to keep Gwibber (or Twitux) open beside Firefox, and glance at it from time to time. But I'm wondering if the two tabs "Messages" and "Replies" means if I'm watching messages, I won't see personal replies. If so, that's not good.

Revision history for this message
Henning Kockerbeck (henning-kockerbeck) wrote :

I'm encountering this problem, too, with Gwibber 0.9.1 from PPA on Ubuntu 8.10, and I'm not sure what to make of it. On the one hand, I'm quite sure I didn't run into any rate limits because my machine has been switched off for the night and Twitux fetches tweets just fine. On the other hand, the same installation of Gwibber worked fine until yesterday evening. The problem started to appear this morning (i. e. it has been for the last few hours), and to my best knowledge I didn't change anything Python-related.

Revision history for this message
Lane Lester (llester) wrote :

Ha! Your experience is just like mine. I should have said that I'm running Linux Mint, a Ubuntu Intrepid variant.

Revision history for this message
macstevejb (macstevejb) wrote :

Exact same problem here.

Running Jaunty beta and Gwibber 0.8.

This only started happening this morning and while I can still download identi.ca updates I cant do the same for Twitter.

Gwibber error message reads: HTTPerror: HTTP Error 401: Unauthorized.

Hope this is fixed soon

Revision history for this message
hyperandy (hyperandy) wrote :

I confirm I am having the same issue this morning from twitter, updates from facebook are working fine.

Revision history for this message
Henning Kockerbeck (henning-kockerbeck) wrote :

Reading this

https://bugs.launchpad.net/gwibber/+bug/358341

I assume it's related. Just a wild guess, but maybe Gwibber is trying to talk to twitter.com using the deprecated/broken API, without any success. After several failed attempts, the twitter rate limit kicks in, and tells Gwibber error 400.

Revision history for this message
fshapps (fshapps) wrote :

Same here, as well.

View -> Errors reports the following:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/__init__.py", line 49, in get_data
    for message in method(client):
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 209, in receive
    for data in self.get_messages():
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 159, in get_messages
    urllib.urlencode({"count": self.account["receive_count"] or "20"})))
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 154, in connect
    url, data, {"Authorization": self.get_auth()})).read()
  File "/usr/lib/python2.5/urllib2.py", line 124, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.5/urllib2.py", line 387, in open
    response = meth(req, response)
  File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.5/urllib2.py", line 425, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request

Revision history for this message
Raif Sarcich (lavilleradieuse) wrote :

Confirmed here as well - behaviour started 2 days ago.

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/__init__.py", line 49, in get_data
    for message in method(client):
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 200, in responses
    for data in self.get_replies():
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 174, in get_replies
    urllib.urlencode({"count": self.account["receive_count"] or "20"})))
  File "/usr/lib/python2.5/site-packages/gwibber/microblog/twitter.py", line 154, in connect
    url, data, {"Authorization": self.get_auth()})).read()
  File "/usr/lib/python2.5/urllib2.py", line 124, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.5/urllib2.py", line 387, in open
    response = meth(req, response)
  File "/usr/lib/python2.5/urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.5/urllib2.py", line 425, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request

Revision history for this message
Eric Noel (profnoel) wrote :

Revision 286 fixes the issues for me on ubuntu 9.04 beta.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.