apport-collect: do not crash on launchpadlib.errors.HTTPError

Bug #338201 reported by Lödur
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Undecided
Unassigned
apport (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

1. Start "gnome-terminal" typing
apport-collect 204819

Error-Messages
---
Logging into Launchpad...
The authorization page (https://edge.launchpad.net/+authorize-token?oauth_token=4CRtXfrwRPlkl5BjQLtg) should be opening in your browser. After you have authorized this program to access Launchpad on your behalf you should come back here and press <Enter> to finish the authentication process.

Traceback (most recent call last):
  File "/usr/bin/apport-collect", line 108, in <module>
    lp = login()
  File "/usr/bin/apport-collect", line 51, in login
    cache_dir)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/launchpad.py", line 154, in get_token_and_login
    credentials.exchange_request_token_for_access_token(web_root)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/credentials.py", line 179, in exchange_request_token_for_access_token
    raise HTTPError(response, content)
launchpadlib.errors.HTTPError: HTTP Error 401: Unauthorized
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 85, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 17] File exists: '/var/crash/_usr_bin_apport-collect.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/apport-collect", line 108, in <module>
    lp = login()
  File "/usr/bin/apport-collect", line 51, in login
    cache_dir)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/launchpad.py", line 154, in get_token_and_login
    credentials.exchange_request_token_for_access_token(web_root)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/credentials.py", line 179, in exchange_request_token_for_access_token
    raise HTTPError(response, content)
launchpadlib.errors.HTTPError: HTTP Error 401: Unauthorized
---

Revision history for this message
Ursula Junque (ursinha) wrote :

Hi,

Where's this apport-collect? I don't have this command in my Ubuntu installation, I'm using Intrepid.
What were you trying to do when hit this problem?

Thanks,

Úrsula

Changed in launchpad:
status: New → Incomplete
Revision history for this message
Lödur (loedur) wrote :

Hallo,

"apport-collect" is in the directory /usr/bin.
It's inside the package "apport", version 0.142
I'm using/testing Jaunty Jackalope 9.04 (developer branch).

Linux 2.6.28-8-generic #28-Ubuntu SMP Thu Mar 5 21:49:36 UTC 2009 i686 GNU/Linux

Lödur (loedur)
Changed in launchpad:
status: Incomplete → New
Revision history for this message
Ursula Junque (ursinha) wrote :

Hi Lodur,

It seems this is an apport bug, not Launchpad. So, I've redirected it to apport package for it to be properly handled.

Thanks for reporting this!

Úrsula

Changed in launchpad:
status: New → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :

So arguably apport-collect shouldn't crash like this, but just print the error message.

It seems that you didn't actually log into Launchpad and chose "change anything"?

Changed in apport:
assignee: nobody → pitti
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

r1319

Changed in apport:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 0.145

---------------
apport (0.145) jaunty; urgency=low

  * apport/crashdb_impl/launchpad.py: Fix typo in previous upload.
  * debian/local/apport-collect: Do not crash on
    launchpadlib.errors.HTTPError, but give a proper error message and point
    out that this script needs "change anything" privileges. (LP: #338201)
  * apport_python_hook.py: Fix crash for already existing reports, and make
    behaviour equivalent to bin/apport: Silently exit for existing unseen
    crash report, and overwrite existing seen crash report. Add test cases.
    (LP: #323714)
  * general-hooks/automatix.py: Refuse to send bug reports when ultamatix is
    installed.

 -- Martin Pitt <email address hidden> Tue, 10 Mar 2009 18:45:34 +0100

Changed in apport:
status: Fix Committed → 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.