package_hook does not include package version

Bug #1485787 reported by Brian Murray
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Martin Pitt
Trusty
Fix Released
High
Brian Murray
Vivid
Fix Released
High
Brian Murray

Bug Description

All of these problem reports are missing a package version:

https://errors.ubuntu.com/problem/abc807de9d9c87d965fea31c865192edb30b6738

This is because package_hook in apport only writes the following:

pr['Package'] = options.package

We should include the package version in the problem report.

Test Case
---------
1) echo "You have failed this city." | /usr/share/apport/package_hook -p apport
2) grep "^Package" /var/crash/apport.1000.crash

With the current version of apport you'll only see the package name, with the version from -proposed you'll see the package version in addition to the name.

Regression Potential
--------------------
Worst case scenario I screwed the patch up and we loose the package name too, but given that it works in wily and there is a test for it in test_hooks.py that seems unlikely.

tags: added: trusty vivid wily
Changed in apport (Ubuntu):
status: New → 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.18-0ubuntu7

---------------
apport (2.18-0ubuntu7) wily; urgency=medium

  * data/package_hook: When creating a Package problem write the version of
    the package to the report. (LP: #1485787)

 -- Brian Murray <email address hidden> Mon, 17 Aug 2015 15:40:39 -0700

Changed in apport (Ubuntu):
status: In Progress → Fix Released
Changed in apport (Ubuntu Trusty):
status: New → Triaged
Changed in apport (Ubuntu Vivid):
status: New → Triaged
Changed in apport (Ubuntu Trusty):
importance: Undecided → High
Changed in apport (Ubuntu Vivid):
importance: Undecided → High
description: updated
Changed in apport (Ubuntu Trusty):
assignee: nobody → Brian Murray (brian-murray)
Changed in apport (Ubuntu Vivid):
assignee: nobody → Brian Murray (brian-murray)
Changed in apport (Ubuntu Vivid):
status: Triaged → In Progress
Changed in apport (Ubuntu Trusty):
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted apport into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.17.2-0ubuntu1.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apport (Ubuntu Vivid):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted apport into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.14.1-0ubuntu3.13 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

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

Note that this isn't how apport is supposed to work: Calling any hook is *not* sufficient for producing a report, you have to let the UI post-process the report; that will call add_package_info() and thus the complete package and version. If you run the test case, and click on "show details", you will see package and version without this patch. I'd therefore like to revert this change in wily.

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

So how come that the error tracker is not getting add_package_info()? This is a deeper problem as we also need to check for/add package origins, modified files, etc.

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

Will handle the fix for wily in bug 1485773.

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

See https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1485773/comments/5 . After actually having looked at this I think that hooks should write a complete Package: field after all; otherwise we force apport to always rewrite the entire apport file, which can be really expensive. So I will fix the hooks after all, see that this becomes simpler, and adjust the tests to catch this.

Changed in apport (Ubuntu):
assignee: Brian Murray (brian-murray) → Martin Pitt (pitti)
milestone: none → ubuntu-15.10
status: Invalid → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in apport (Ubuntu):
milestone: ubuntu-15.10 → ubuntu-15.09
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

r2996 does not change the iwlwifi_error_dump hook or the apportcheckresume hook which also writes a Package field to its report.

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

Thanks Brian! Fixed in http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/2998 . I went through all data/*, should be complete now.

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

Setting up apport (2.17.2-0ubuntu1.4) ...
bdmurray@blacklightning:~$ echo "You have failed this city." | /usr/share/apport/package_hook -p apport
bdmurray@blacklightning:~$ grep "^Package" /var/crash/apport.1000.crash
Package: apport 2.17.2-0ubuntu1.4

tags: added: verification-done-vivid
Revision history for this message
Brian Murray (brian-murray) wrote :

Setting up apport (2.14.1-0ubuntu3.13) ...
apport start/running
bdmurray@clean-trusty-amd64:~$ echo "You have failed this city." | /usr/share/apport/package_hook -p apport
bdmurray@clean-trusty-amd64:~$ grep "^Package" /var/crash/apport.1000.crash
Package: apport 2.14.1-0ubuntu3.13

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

This bug was fixed in the package apport - 2.14.1-0ubuntu3.13

---------------
apport (2.14.1-0ubuntu3.13) trusty-proposed; urgency=medium

  * data/package_hook: when creating the problem report include the version of
    the package. (LP: #1485787)

 -- Brian Murray <email address hidden> Wed, 26 Aug 2015 16:16:52 -0700

Changed in apport (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for apport has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.17.2-0ubuntu1.4

---------------
apport (2.17.2-0ubuntu1.4) vivid-proposed; urgency=medium

  * data/package_hook: when creating the problem report include the version of
    the package. (LP: #1485787)

 -- Brian Murray <email address hidden> Wed, 26 Aug 2015 15:49:41 -0700

Changed in apport (Ubuntu Vivid):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.18.1-0ubuntu1) wily; urgency=medium

  * New upstream bug fix release. Changes since our previous snapshot:
    - packaging.py: Only consider first word in /etc/os-release's NAME value.
      This works around Debian's inconsistent value. (LP: #1408245)
    - Unify and simplify Package: field generation in kernel_crashdump,
      kernel_oops, and package_hook by using the new Report.add_package()
      method. (LP: #1485787)
    - sandboxutils.py, make_sandbox(): Make "Cannot find package which ships
      Executable/InterpreterPath" fatal, to save some unnecessary package
      unpack cycles. (LP: #1487174)
  * etc/apport/crashdb.conf: Enable crash reports on Launchpad for wily.
    Really late, sorry about that!

 -- Martin Pitt <email address hidden> Thu, 10 Sep 2015 11:48:46 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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