apport-collect crashes due to launchpadlib.errors.CredentialsFileError

Bug #414055 reported by nh2 on 2009-08-15
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Low
Marco Rodrigues
python-launchpadlib (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: apport

After I got a kernel panic while trying to upload a crash report with apport-collect and had to restart the system, apport doesn't start anymore. I could not find any information about the error message:

niklas@hermes ~ % apport-collect -p linux 412704
Logging into Launchpad...
Downloading bug...
Traceback (most recent call last):
  File "/usr/bin/apport-collect", line 106, in <module>
    bug = crashdb.launchpad.bugs[int(bug_number)]
  File "/usr/lib/python2.6/dist-packages/apport/crashdb_impl/launchpad.py", line 89, in launchpad
    credentials.load(open(self.auth))
  File "/usr/lib/python2.6/dist-packages/launchpadlib/credentials.py", line 85, in load
    CREDENTIALS_FILE_VERSION)
launchpadlib.errors.CredentialsFileError: No configuration for version 1

What could that mean?

Related branches

Martin Pitt (pitti) wrote :

Launchpadlib developers, do you have some advice what to do with this? Thanks in advance!

Changed in apport (Ubuntu):
status: New → Incomplete
summary: - apport-collect crashes
+ apport-collect crashes due to launchpadlib.errors.CredentialsFileError
James Westby (james-w) wrote :

Hi,

I think you have to catch this error and treat it as "no credentials".

My bet is that the file is empty due to issues when writing. When
trying to read it isn't in the required format and so no credentials
can be gained, therefore it raises an error so that the caller can
do something about it if they like. Therefore I think it's part of
the interface.

Can you suggest a better way this could be handled?

Thanks,

James

Marco Rodrigues (gothicx) wrote :

James, you're right, it happens when the credentials file is empty.

$ echo > ~/.cache/apport/launchpad.credentials

$ apport-collect -p linux 412704
Logging into Launchpad... You have to allow "Change anything" privileges.
Downloading bug information...
Traceback (most recent call last):
  File "/usr/bin/apport-collect", line 106, in <module>
    bug = crashdb.launchpad.bugs[int(bug_number)]
  File "/usr/lib/python2.6/dist-packages/apport/crashdb_impl/launchpad.py", line 97, in launchpad
    credentials.load(open(self.auth))
  File "/usr/lib/python2.6/dist-packages/launchpadlib/credentials.py", line 83, in load
    CREDENTIALS_FILE_VERSION)
lazr.restfulclient.errors.CredentialsFileError: No configuration for version 1

Apport can do something like:

if os.path.exists(self.auth) and os.path.getsize(self.auth) > 1:
    # use existing credentials

Martin Pitt (pitti) wrote :

Right, thanks. I think the most user friendly way would be to delete the file and re-authenticate. It's in ~/.cache, after all.

Changed in python-launchpadlib (Ubuntu):
status: New → Invalid
Changed in apport (Ubuntu):
importance: Undecided → Low
status: Incomplete → Triaged
Changed in apport (Ubuntu):
assignee: nobody → Marco Rodrigues (gothicx)
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

trunk r1616

Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 1.9.2-0ubuntu1

---------------
apport (1.9.2-0ubuntu1) karmic; urgency=low

  * New upstream bug fix release:
    - apport-cli: Print the URL and ask whether to open a browser. In many
      situations (such as usage on a server through ssh), it's preferable to not
      open the browser on the reporting computer. Thanks to Matt Zimmerman for the
      initial patch! (LP: #286415)
    - general-hooks/generic.py: Collect important glib errors/assertions (which
      should not have private data) from ~/.xsession-errors (LP: #431807)
    - launchpad.py: Link hardware data submission key if it exists. (LP: #424382)
    - apport-cli: Fix crash with non-ASCII characters in prompts.
    - Fix "apport-bug symptomname" to actually work.
    - launchpad.py: Fix crash on invalid credentials file. Thanks to Marco
      Rodrigues for the initial patch! (LP: #414055)
  * man/apport-bug.1: Document APPORT_IGNORE_OBSOLETE_PACKAGES (cherrypicked
    from trunk), and APPORT_STAGING (Ubuntu specific change, since it's a
    launchpad backend specific variable).
  * bin/apport-bug: Ignore -p option when giving two arguments, to keep
    compatibility with current bug filing instructions. (LP: #356755)
  * debian/copyright: Update copyright year and fix GPL link, thanks Marco
    Rodrigues!

 -- Martin Pitt <email address hidden> Fri, 02 Oct 2009 13:25:58 +0200

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
nh2 (nh2) wrote :

Reopening test if apport-collect works now and transfers data

Changed in apport (Ubuntu):
status: Fix Released → Fix Committed
nh2 (nh2) wrote : apport-collect data

Architecture: i386
DistroRelease: Ubuntu 9.10
Package: apport 1.9.2-0ubuntu2
PackageArchitecture: all
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/usr/bin/zsh
Uname: Linux 2.6.31-rc6-wl i686
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

nh2 (nh2) wrote : ApportLog.txt
nh2 (nh2) wrote : CrashReports.txt
nh2 (nh2) wrote : Dependencies.txt
nh2 (nh2) wrote : XsessionErrors.txt
tags: added: apport-collected
nh2 (nh2) wrote :

Test successfull, apport works fine now

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers