ubuntu general hook doesn't know how to read .gz files

Bug #917903 reported by Brian Murray
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Brian Murray

Bug Description

I received the following crash on precise:

..................................ERROR: hook /usr/share/apport/general-hooks/ubuntu.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 703, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/general-hooks/ubuntu.py", line 41, in add_info
    check_attachment_for_errors(report, log)
  File "/usr/share/apport/general-hooks/ubuntu.py", line 141, in check_attachment_for_errors
    if attachment in report and re.search(grub_error, report[attachment], re.MULTILINE):
  File "/usr/lib/python2.7/re.py", line 142, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

This happened because the general hook was trying to check 'VarLogDistupgradeApttermlog' for errors and the attachment is a .gz file. .gz files also become an issue when a duplicate-signature is created for package install failures.

Revision history for this message
Brian Murray (brian-murray) wrote :

Martin do you have any ideas about how to deal with this situation?

Revision history for this message
Martin Pitt (pitti) wrote :

We could add a new accessor to the Report object that transparently unpacks gzipped values, such as report.getgz('key_name')?

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

Maybe it's even better to avoid attaching gzipped log files if we want to process them? That'd need to be fixed in apt/update-manager, though.

Revision history for this message
Brian Murray (brian-murray) wrote :

I'm pretty sure update-manager doesn't do any gzipping of the log files. DistUpgradeApport.py calls /usr/share/apport/package_hook and neither of these gz the attachments. So the first idea sounds best to me.

Changed in apport (Ubuntu):
status: Triaged → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.5.1-0ubuntu7

---------------
apport (2.5.1-0ubuntu7) quantal-proposed; urgency=low

  * bin/apport-bug: Explicitly set the PATH to that of ENV_SUPATH in
    /etc/login.defs and unset ENV and CDPATH. We need do this so that confined
    applications using ubuntu-browsers.d/ubuntu-integration cannot abuse the
    environment to escape AppArmor confinement via this script (LP: #1045986).
    This can be removed once AppArmor supports environment filtering
    (LP: 1045985)

apport (2.5.1-0ubuntu6) quantal; urgency=low

  * data/general/ubuntu.py: handle the case where a log file is compressed
    when reviewing package installation failures (LP: #917903)

apport (2.5.1-0ubuntu5) quantal; urgency=low

  * Use Python string rather than QString, LP: #1028984
 -- Jamie Strandboge <email address hidden> Wed, 05 Sep 2012 08:38:23 -0500

Changed in apport (Ubuntu):
status: In Progress → 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.