hooks: don't add incomplete Package: information

Bug #1485773 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
In Progress
Medium
Martin Pitt

Bug Description

I was trying to figure out why package installation failures didn't always have package versions in them e.g.

https://errors.ubuntu.com/problem/abc807de9d9c87d965fea31c865192edb30b6738
https://errors.ubuntu.com/oops/7dcf4756-42b9-11e5-a0ab-fa163e78b027

Digging into this I discovered that package_hook from apport writes a Package key but does not include the version of the package with that key. Apparently, I fixed the same thing 18 months ago with the kernel_oops file.

apport (2.13.2-0ubuntu4) trusty; urgency=medium

  * data/kernel_oops: include the package version in addition to the name

 -- Brian Murray <email address hidden> Fri, 14 Feb 2014 14:09:39 -0800

Investigating the matter further it, report.write() is called with new_only=True which means that even though the package version information has been collected (by add_package_info) we do not write it to the report. Naturally, this is rather confusing and means that fixes to data collection in apport may not appear in all reports e.g. if we change how origin information is calculated (which appears in the value for Package) we need to change package_hook and kernel_oops for the updated origin information.

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

I'm going to go ahead and just add the version information in the package_hook, but pitti could you have a look at the larger issue?

tags: added: wily
Changed in apport (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
assignee: Brian Murray (brian-murray) → Martin Pitt (pitti)
Martin Pitt (pitti)
Changed in apport (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

Reproducer:

  echo foo | /usr/share/apport/package_hook -p apport

The displayed information includes the full Package: field, but the written .crash file does now.

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

This was worked around for stables in bug 1485787

Martin Pitt (pitti)
summary: - new_only option when writing reports stops some data from being written
+ only_new option when writing reports stops some data from being written
Changed in apport (Ubuntu):
milestone: none → ubuntu-15.09
Revision history for this message
Martin Pitt (pitti) wrote : Re: only_new option when writing reports stops some data from being written
Revision history for this message
Martin Pitt (pitti) wrote :

I looked at this more deeply now. Using only_new makes sense as we want to write the report in "append" mode, to avoid having to unnecessarily rewrite potentially large reports (core dumps, kernel crash dumps). So indeed we should fix the hooks to just call add_package_info() instead of the current dance.

summary: - only_new option when writing reports stops some data from being written
+ hooks: don't add incomplete Package: information
Martin Pitt (pitti)
Changed in apport (Ubuntu):
milestone: ubuntu-15.09 → none
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.