apport-cli saves reports for later with a .txt suffix, but ubuntu-bug wants saved reports to have .crash suffix

Bug #401983 reported by Steve Beattie
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt
Jaunty
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: apport

When saving a report for later with apport-cli (as invoked from ubuntu-bug on an ubuntu-server install), the report is saved with a .txt suffix; however, the /usr/bin/ubuntu-bug shell script only treats files with a .crash suffix as saved crash reports, thus the saved crash report gets mistreated as a regular file and looked up via 'dpkg-query --search' to find out which package it belongs to, which of course fails:

  $ ubuntu-bug apport

  *** Collecting problem information

  The collected information can be sent to the developers to improve the
  application. This might take a few minutes.
  ......

  *** Send problem report to the developers?

  After the problem report has been sent, please fill out the form in the
  automatically opened web browser.

  What would you like to do? Your options are:
    S: Send report (1.5 KiB)
    V: View report
    K: Keep report file for sending later or copying to somewhere else
    C: Cancel
  Please choose (S/V/K/C): k
  Problem report file: /tmp/apport.Q0HSQt.txt

  $ ubuntu-bug /tmp/apport.Q0HSQt.txt
  dpkg: /tmp/apport.Q0HSQt.txt not found.
  Path '/tmp/apport.Q0HSQt.txt' does not match any package
  Usage: apport-cli [options]

  apport-cli: error: -p option requires an argument

Manually invoking apport-cli -c /blah/blah/report.txt correctlyopens the saved report file. Either apport-cli should change it's emitted suffix or ubuntu-bug should consider other files as report files.

ProblemType: Bug
Architecture: i386
CrashReports: 600:0:0:296329:2009-07-17 09:59:23.295992000 -0700:2009-07-20 14:31:00.646340511 -0700:/var/crash/update-motd.0.crash
Date: Mon Jul 20 16:33:05 2009
DistroRelease: Ubuntu 9.10
LiveMediaBuild: Ubuntu 9.10 "Karmic Koala" - Alpha i386 (20090716)
Package: apport 1.6-0ubuntu1
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-3.19-generic
SourcePackage: apport
Uname: Linux 2.6.31-3-generic i686

Revision history for this message
Steve Beattie (sbeattie) wrote :
Revision history for this message
Steve Beattie (sbeattie) wrote :

Attached is patch that changes the saved file format to apport.$PACKAGE_NAME_$VERSION.XXXXXX.apport and causes apport to treat files named *.apport as saved reports.

Changed in apport (Ubuntu):
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

apport-cli fixed in trunk r1555.
ubuntu-bug fixed in apport/ubuntu r1510.

Thanks!

Changed in apport (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Low
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

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

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

  * New upstream bug fix release:
    - data/general-hooks/generic.py: Check $HOME, not /home for enough space.
      (LP: #422658)
    - launchpad.py: Intercept httplib2.ServerNotFoundError as well, to avoid
      crashes when being offline. (LP: #396276)
    - apport-cli: Save reports with .apport extension instead of .txt. Thanks
      to Steve Beattie! (LP: #401983)
    - fileutils.py, likely_packaged(): Ignored crashes in /var, packages don't
      ship executables there, and it creates false positives. (LP: #414368)
    - packaging-apt-dpkg.py, get_modified_files(): Fix crash with empty lines.
      (LP: #408280)
    - packaging-apt-dpkg.py: Use installed version instead of candidate
      version where appropriate. This also fixes a crash where an obsolete
      package is not available any more. (LP: #423511)
    - hookutils.py, attach_gconf(): Fix crash with keys which do not have a
      schema default. (LP: #422277)
    - launchpad.py: Remove LP #353805 workaround, seems fixed now.
    - launchpad.py: Talk to staging if $APPORT_STAGING is set.
    - launchpad.py: Explicitly supply content_type for addAttachment, current
      wadllib requires it now.
    - apport_python_hook.py: Paper over inexplicable import error.
      (LP: #348250)
    - apport_python_hook.py: Protect against nonexisting sys.argv.
      (LP: #418051)
    - apport/ui.py, load_report(): Check that report has ProblemType field.
      (LP: #198543)
    - ui.py: Fix handling of complete vs. reduced report size. (LP: #92653).
      This also fixes a race condition crash with os.path.getsize().
      (LP: #348137)
    - fi.po: Fix mistranslation of "&Cancel". (LP: #355303)
    - apport-{gtk,kde}: Check for having $DISPLAY at startup to avoid crashes.
      (LP: #411276)
    - report.py, add_gdb_info(): Fix race condition in unlink_core, thanks to
      Tommi Komulainen! (LP: #397945)
    - ui.py, load_report(): Robustify check whether program is still
      installed. (LP: #329184)
    - packaging-apt-dpkg.py, install_retracing_packages(): Install package for
      ExecutablePath/InterpreterPath if missing; this can happen with package
      hooks which reassing package
    - launchpad.py: Add a comment when marking a bug as a duplicate.
      (LP: #418871)
  * Move gdb dependency from apport to GUI packages to avoid pulling in gdb on
    Ubuntu server. Thanks to Steve Beattie! (LP: #354172)
  * ubuntu-bug: Fix handling of .crash file arguments, thanks to Marco
    Rodrigues for pointing this out! (LP: #422881)
  * debian/local/apport-collect: Set content_type and description, wadllib
    requires them now. (LP: #423512) Also drop the ASCII reencoding
    workaround, this doesn't seem to be necessary any more.
  * apport/hookutils.py, attach_conffiles(): Fix crash with obsolete
    conffiles. (LP: #412132)
  * debian/local/apport-collect: Do not upload data if the affected package
    isn't installed and there is no source package hook available either.
    (LP: #417277)
  * debian/local/ubuntu-bug: Accept .apport extension, too; thanks to Steve
    ...

Read more...

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Attached is a debdiff for jaunty that will resolve this bug and bug 353253. I think this is important to have SRUed for Jaunty with the +filebug changes happening on Launchpad.

Changed in apport (Ubuntu Jaunty):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

I agree, this patch looks fine.

Changed in apport (Ubuntu Jaunty):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted apport into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Revision history for this message
Steve Beattie (sbeattie) wrote :

The version of apport in jaunty-updates, 1.0-0ubuntu5.2, fails to save reports at all. The version in jaunty-proposed, 1.0-0ubuntu5.3, saves reports correctly with the .apport suffix and the apport-{gtk,cli} commands upload the saved files. However, the jaunty-proposed version still suffers from bug 422881, and so invoking ubuntu-bug on the saved report fails with:

  *** Error: Invalid problem report
  No such file or directory

Changed in apport (Ubuntu Jaunty):
status: Fix Committed → Fix Released
Martin Pitt (pitti)
Changed in apport (Ubuntu Jaunty):
status: Fix Released → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Steve, thanks for pointing out. The "Invalid problem report" problem is tracked in bug 422881, I'm preparing a jaunty update for this as well.

Revision history for this message
Steve Beattie (sbeattie) wrote :

Martin, thanks. With the fix for bug 422881 in place, I can confirm that the updated version of apport in jaunty-proposed, 1.0-0ubuntu5.4, saves reports with a .apport extension and that ubuntu-bug will successfully read and report those saved bug reports. Other functionality continues to work, no sign of regression due to these changes. Marking verification-done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 1.0-0ubuntu5.4

---------------
apport (1.0-0ubuntu5.4) jaunty-proposed; urgency=low

  * ubuntu-bug: Fix handling of .crash file arguments, to make the previous
    SRU actually work in a sensible manner. Patch backported from upstream
    version 1.8.1 (trunk r1506). (LP: #422881)

apport (1.0-0ubuntu5.3) jaunty-proposed; urgency=low

  * Backporting of two patches to improve offline bug filing
    - apport-cli: Fix report saving in "bug report" mode. (LP: #353253)
    - apport-cli: Save reports with .apport extension instead of .txt. Thanks
      to Steve Beattie! (LP: #401983)

 -- Martin Pitt <email address hidden> Fri, 25 Sep 2009 09:19:38 +0200

Changed in apport (Ubuntu Jaunty):
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

Related blueprints

Remote bug watches

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