Gwibber is exceeding the Twitter rate limit (HTTP Error 400: Bad request)

Bug #359885 reported by Andres Monroy-Hernandez
60
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Gwibber
Fix Released
Undecided
Unassigned

Bug Description

It works for Identi.ca but not for Twitter.

I am running Gwibber 0.8 on Ubuntu 9.04 Beta.

This is the debug output:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/__init__.py", line 46, in get_data
    for message in method(client):
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 216, in receive
    for data in self.get_messages():
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 166, in get_messages
    urllib.urlencode({"count": self.account["receive_count"] or "20"})))
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/twitter.py", line 161, in connect
    url, data, {"Authorization": self.get_auth()})).read()
  File "/usr/lib/python2.6/urllib2.py", line 124, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 389, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 502, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 427, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 361, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 510, 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
davee (davee-sungate) wrote :

"HTTPError: HTTP Error 400: Bad Request" - I see this too for Twitter. Gwibber had been working fine until a few days ago. Breakage in a recent update, perhaps?

Having said that, my current version is Gwibber 0.9.1 which is different to the version for the reporter above - perhaps breakage in a related library?

I have

   deb http://ppa.launchpad.net/gwibber-team/ppa/ubuntu intrepid main

in my sources and keep up to date.

I note that other Twitter clients (e.g. Twitux) are working OK.

Revision history for this message
Rui Andrada (shingonoide) wrote :

I can confirm that, I think there's two day I can't recive updates from twitter and check log error a got Bad Request 400 error too.
I'm using intrepid.
I think the error, it's because of recent twitter update.

testing on gTwitter does not work too.

Revision history for this message
Prinice Neyland (overtninja) wrote :

The problem is that Twitter changed their API and it broke Gwibber. A fix was released a few days ago and it should make its way into jaunty soon.

@davee: The gwibber-team PPA hasn't been updated yet since this fix was released.

Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

Olá davee e a todos.

On Sunday 12 April 2009 10:15:20 davee wrote:
> I note that other Twitter clients (e.g. Twitux) are working OK.

I'm using daily and I see this too.
But another twit client is affected in exactly the same way and duration. when gwibber is 400 µblog-purple is also.
When one comes back, so does the other. This sounds more like a twitter prob then gwibber.

$ apt-cache policy gwibber
gwibber:
  Installed: 1.0.1~bzr286-0ubuntu1~daily1
  Candidate: 1.0.1~bzr286-0ubuntu1~daily1
  Version table:
 *** 1.0.1~bzr286-0ubuntu1~daily1 0
        500 http://ppa.launchpad.net jaunty/main Packages
        100 /var/lib/dpkg/status
     0.9.1~bzr255-0ubuntu1~fta1 0
        500 http://ppa.launchpad.net jaunty/main Packages
     0.8-0ubuntu3 0
        500 ftp://darkstar.ist.utl.pt jaunty/universe Packages
        500 ftp://archive.ubuntu.com jaunty/universe Packages

--
Hi, I'm BUGabundo, and I am Ubuntu (whyubuntu.com)
(``-_-´´) http://LinuxNoDEI.BUGabundo.net && Ubuntu LoCoTeam Portugal http://ubuntu-pt.org
Linux user #443786 GPG key 1024D/A1784EBB

Revision history for this message
Dominic Evans (oldmanuk) wrote :

this bug was incorrectly marked as a duplicate.

however, it is a result of the fix imposed on us by bug 358341

basically Gwibber was (one of many) clients cheating the system by using POST requests for the timeline(s). Twitter were only measuring GET requests against the rate limit so Gwibber was able to get away with whatever it wanted.

currently you are allocated 100 requests an hour and you can query your current remaining number of hits from the API yourself and when your count was last reset to 100:
{{{
$ curl -u username http://twitter.com/account/rate_limit_status.json
{"hourly_limit":100,"reset_time":"Sun Apr 12 23:32:59 +0000 2009","reset_time_in_seconds":1239579179,"remaining_hits":57}
}}}

so if you have your refresh time set to 1 minute, then just Messages & Replies will trigger your count in 50 minutes

if you have any gwibber:user profile tabs, hash tags or search tabs open these will also count towards your limit so you'll run out even quicker

summary: - HTTP Error 400: Bad request when connecting to Twitter
+ Gwibber is exceeding the Twitter rate limit (HTTP Error 400: Bad
+ request)
Revision history for this message
Dominic Evans (oldmanuk) wrote :

unfortunately have to mark this as invalid as its not a Gwibber problem but a Twitter API problem upstream

Changed in gwibber:
status: New → Invalid
Revision history for this message
Dominic Evans (oldmanuk) wrote :

p.s. the rate limit is per authenticating user credentials, so if you are running any other Twitter apps elsewhere (e.g., running Gwibber on two machines at once) they will be sharing the same count

Revision history for this message
Dominic Evans (oldmanuk) wrote :

on second thoughts, re-opening this bug, perhaps we need to consider adding some better user feedback when the rate is exceeded (as it is likely to happen quite often)

Changed in gwibber:
status: Invalid → New
Revision history for this message
Dominic Evans (oldmanuk) wrote :

For people's reference, this is the API change that causes us (and all other apps) to be rate limited now, when we weren't before

"From Twitter API Changelog (http://apiwiki.twitter.com/REST%20API%20Changelog)

# Fixed (REST): Methods documented as requiring GET were allowing POST and not counting the rate limit correctly. These methods now require GET and return an error message if POST is used."

Revision history for this message
Prinice Neyland (overtninja) wrote :

@ Dominic: The bug reporter is using Gwibber 0.8 from the jaunty repo which is still using POST requests.

Revision history for this message
Hector Miuler Malpica Gallegos (miuler) wrote :

Tengo el mismo mensaje de error, estoy usando ubuntu 9.04 y gwibber del repositorio lp:wgibber.

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

Twitter has been broken four days for me.

I don't believe 'rate limiting' because I logged in (gwibber 0.8 I believe) for the first time in three days and immediately started getting "400: Bad Request" errors from twitter. Immediately as in 'right away, on the very first request in three days'

I've just upgraded to gwibber 1.0.2 and now I'm getting 401: bad authentication" from both twitter and identica.

Any suggestions?

Revision history for this message
James Gregory-Monk (jamgregory) wrote :

Are you sure you've got your authentication details correct? Bad authentication is only likely to come up if the details are incorrect. Re-entering them into the relevant configuration boxes should fix this.

Revision history for this message
Prinice Neyland (overtninja) wrote :

@ zcat: Gwibber 0.8 had Gnome keyring support and in version 1.0.2 it is removed and because of this, your password isn't stored in gconf anymore. Edit your password in the manage account dialog and all should be fine. You might have to wait a while to be able to login to twitter again as they temporally block logins after a number of unsuccessful login attempts.

Revision history for this message
davee (davee-sungate) wrote :

Appears fixed in Gwibber 0.9.2 from the Intrepid PPA, downloaded/installed this morning. Thanks chaps :-)

Revision history for this message
markb (mark-blakeney) wrote :

I'm new to gwibber + twitter and just installed gwibber 0.9.2 from the intrepid ppa but I'm getting this "HTTP Error 400: Bad Request" for my twitter account. Since it seems I have the latest gwibber version, why would I still be getting this problem?

Revision history for this message
John Vivirito (gnomefreak) wrote :
Download full text (3.4 KiB)

gnomefreak@Development:~/mozilla-builds/jaunty/2.0/work/ubuntu-2.x/debian/patche
s$ gwibber
/usr/lib/python2.6/dist-packages/gwibber/microblog/support/facelib.py:47: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
console message: @1: ReferenceError: Can't find variable: addMessages
console message: @22: ReferenceError: Can't find variable: setGtkConfig
console message: @1: ReferenceError: Can't find variable: setAccountConfig
console message: @1: ReferenceError: Can't find variable: addMessages
console message: @22: ReferenceError: Can't find variable: setGtkConfig
console message: file:///usr/share/gwibber/ui/themes/default/jquery.js @22: SyntaxError: Parse error
console message: file:///usr/share/gwibber/ui/themes/default/theme.html @150: ReferenceError: Can't find variable: $
console message: file:///usr/share/gwibber/ui/themes/default/jquery.js @1: SyntaxError: Parse error
/usr/lib/python2.6/dist-packages/gwibber/client.py:774: GtkWarning: gtk_tree_model_filter_get_value: assertion `GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed
  errorwin.show_all()
/usr/lib/python2.6/dist-packages/gwibber/client.py:774: Warning: g_object_set_property: assertion `G_IS_VALUE (value)' failed
  errorwin.show_all()
/usr/lib/python2.6/dist-packages/gwibber/client.py:774: Warning: g_value_unset: assertion `G_IS_VALUE (value)' failed
  errorwin.show_all()
/usr/lib/python2.6/dist-packages/gwibber/table.py:35: GtkWarning: gtk_tree_model_filter_convert_iter_to_child_iter: assertion `filter_iter->stamp == filter->priv->stamp' failed
  i = tree.filter.convert_iter_to_child_iter(iter)
/usr/lib/python2.6/dist-packages/gwibber/table.py:17: GtkWarning: gtk_list_store_get_value: assertion `VALID_ITER (iter, list_store)' failed
  return self[iter][0]
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/table.py", line 36, in custom_handler
    o = tree.filter.get_model().get_obj(i)
  File "/usr/lib/python2.6/dist-packages/gwibber/table.py", line 17, in get_obj
    return self[iter][0]
TypeError: unknown type (null)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 93, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 13] Permission denied: '/var/crash/_usr_bin_gwibber.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/table.py", line 36, in custom_handler
    o = tree.filter.get_model().get_obj(i)
  File "/usr/lib/python2.6/dist-packages/gwibber/table.py", line 17, in get_obj
    return self[iter][0]
TypeError: unknown type (null)
/usr/lib/python2.6/dist-packages/gwibber/client.py:774: GtkWarning: gtk_tree_model_filter_iter_next: assertion `GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed
  errorwin.show_all()
/usr/lib/python2.6/dist-packages/gwibber/client.py:774: GtkWarning: file /build/buildd/gtk+2.0-2.16.0/gtk/gtktreeview.c: line 6142 (do_validate_rows): assertion `gtk_tree_model_iter_next (tree_view->priv->model, &iter)' failed.
There is a disparity between the internal view of the G...

Read more...

Revision history for this message
John Vivirito (gnomefreak) wrote :

Does anyone else see the following using the command given?

gnomefreak@Development:~/mozilla-builds/jaunty/2.0/work/ubuntu-2.x/debian/patche
s$ curl -u USER http://twitter.com/account/rate_limit_status.json
Enter host password for user 'USER':
{"remaining_hits":100,"hourly_limit":100,"reset_time":"Tue Apr 14 14:08:09 +0000 2009","reset_time_in_seconds":1239718089

Revision history for this message
Alexander Sack (asac) wrote :

Dominic, do "searches" count as hits too?

Revision history for this message
Jonathan Blackhall (johnny-one-eye) wrote :
Revision history for this message
markb (mark-blakeney) wrote :

@jonathan Well no matter what I did yesterday it stayed broke. Today I fired up gwibber after getting your comment and it seems to be working fine? I didn't change anything other than wait for 16 hours. Didn't re-enter my password anywhere either. Thanks for caring ... ;)

Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

@gnomefreak replace USER with your username

Revision history for this message
Juan Simón (simonbcn) wrote :

Same problem:
Ubuntu Jaunty
gwibber:
  Instalados: 0.9.2~bzr263-0ubuntu1~jaunty
  Candidato: 0.9.2~bzr263-0ubuntu1~jaunty
  Tabla de versión:
 *** 0.9.2~bzr263-0ubuntu1~jaunty 0
        500 http://ppa.launchpad.net jaunty/main Packages
        100 /var/lib/dpkg/status
     0.8-0ubuntu5 0
        500 http://es.archive.ubuntu.com jaunty/universe Packages

Revision history for this message
Omer Akram (om26er) wrote :

Is this still an issue with gwibber 2.29.94?

Changed in gwibber:
status: Confirmed → Incomplete
Revision history for this message
Rui Andrada (shingonoide) wrote :

for me now it's working, I think this is outdated bug.

Omer Akram (om26er)
Changed in gwibber:
status: Incomplete → Fix Released
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.