Gwibber urllib2.HTTPError: HTTP Error 401: Unauthorized on attempt to add Twitter account

Bug #640881 reported by Adam Drew
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gwibber (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: gwibber

Issue:
- Cannot add Twitter account to Gwibber
- Clicking the "Authorize" button to Oauth Gwibber results in the following traceback at the console:
 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/gwibber/lib/gtk/twitter.py", line 72, in on_twitter_auth_clicked
    tokendata = urllib2.urlopen(request.http_url, request.to_postdata()).read()
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

Environment:
- Ubuntu 10.04
- Reproduced on brand new fully updated install with no additional packages installed
- gwibber 2.30.2-0ubuntu1
- gwibber-service 2.30.2-0ubuntu1

Steps to Reproduce:
- Install Ubuntu 10.04
- Update system to all latest updates
- Reboot system
- Click MeMenu
- Click "Set up Broadcast Accounts"
- Select "Twitter" from the drop down
- Click big red "Authorize" button
- Observe no feedback in the GUI. Nothing appears to happen.
- Run gwibber from the terminal
- Repeat steps though the Add Account dialog
- Observe above mentioned trace back

Revision history for this message
Adam Drew (adamrdrew) wrote :

As a follow-on: yes, I can add other accounts without issue.

Revision history for this message
Adam Drew (adamrdrew) wrote :

So I "fixed" it but killing gwibber and gwibber-service and then starting gwibber again. Then, after hitting authorize, the oAuth box came up and it worked. However, I have the something similar happen now whenever I try to use gwibber after waking from hibernate. I think the problem has something to do with hibernation. I got the following traceback after trying to start gwibber after hibernate:

Traceback (most recent call last):
  File "/usr/bin/gwibber", line 67, in <module>
    client.Client()
  File "/usr/lib/python2.6/dist-packages/gwibber/client.py", line 448, in __init__
    self.w = GwibberClient()
  File "/usr/lib/python2.6/dist-packages/gwibber/client.py", line 42, in __init__
    if len(json.loads(self.service.GetAccounts())) == 0:
  File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.socket.error: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.6/dist-packages/gwibber/microblog/dispatcher.py", line 491, in GetAccounts
    for account in self.accounts.get_records(COUCH_TYPE_ACCOUNT, True):
  File "/usr/lib/python2.6/dist-packages/desktopcouch/records/server_base.py", line 482, in get_records
    exists = self.view_exists(view_name, design_doc)
  File "/usr/lib/python2.6/dist-packages/desktopcouch/records/server_base.py", line 429, in view_exists
    self.with_reconnects(self.db.__getitem__, doc_id)["views"]
  File "/usr/lib/python2.6/dist-packages/desktopcouch/records/server_base.py", line 164, in with_reconnects
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 316, in __getitem__
    resp, data = self.resource.get(id)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 978, in get
    return self._request('GET', path, headers=headers, **params)
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1014, in _request
    resp, data = _make_request()
  File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1009, in _make_request
    body=body, headers=headers)
  File "/usr/lib/pymodules/python2.6/httplib2/__init__.py", line 1129, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/pymodules/python2.6/httplib2/__init__.py", line 901, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/pymodules/python2.6/httplib2/__init__.py", line 875, in _conn_request
    conn.connect()
  File "/usr/lib/pymodules/python2.6/httplib2/__init__.py", line 750, in connect
    raise socket.error, msg
error: [Errno 111] Connection refused

I then killed gwibber and gwibber service and started it back up and it worked. So the problem appears to be localized to post-hibernate. That would make this bug a dup of https://bugs.launchpad.net/ubuntu/+source/desktopcouch/+bug/522538.

Revision history for this message
Adam Drew (adamrdrew) wrote :

This can be closed. I'll address my issues in 522538.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gwibber (Ubuntu):
status: New → Confirmed
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.