apport-collect doesn't create a ProblemType in the report

Bug #1766794 reported by John George on 2018-04-25
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
High
Unassigned
apport (Ubuntu)
High
Unassigned
Bionic
High
Brian Murray

Bug Description

Running 'sudo apport-collect BUGID' on 18.04 and then selecting 'V: View report' results in Tracebacks.

[Test Case]
1) ssh to a system running bionic
2) run apport-collect 1766787
3) say yes that you want to update a bug report that isn't yours
4) Choose to view the report
5) Observe the following Traceback

ERROR: hook /usr/share/apport/general-hooks/generic.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 198, in _run_hook
    symb['add_info'](report, ui)
  File "/usr/share/apport/general-hooks/generic.py", line 90, in add_info
    if report['ProblemType'] == 'Crash':
  File "/usr/lib/python3.6/collections/__init__.py", line 991, in __getitem__
    raise KeyError(key)
KeyError: 'ProblemType'

With the version of the package from -proposed you will not see the Traceback.

[Regression Potential]
The change is just to stop removing the ProblemType from the created report so there really isn't a chance of a regression.

John George (jog) wrote :
John George (jog) wrote :

||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii apport 2.20.9-0ubun all automatically generate crash repo

$ lsb_release -ad
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04
Codename: bionic

Brian Murray (brian-murray) wrote :

Do you happen to have a copy of the report that was created? It should be in /var/crash.

summary: - Tracebacks when View report is selected
+ apport-collect with debian-installer doesn't create a ProblemType in the
+ report
Brian Murray (brian-murray) wrote :

Sorry, I meant the debian-installer report that was created. Maybe choose K for Keep instead of View.

John George (jog) wrote :

hmm, the bug I was trying to report on has now been fixed and I've re-installed that test system.
Without the crash from the original bug I don't get a report just 'No pending crash reports'.

Brian Murray (brian-murray) wrote :

I was able to recreate this by running apport-collect on bug 1766787 and it crashed whether I choose to view the report or keep it. The same thing happens with a ubiquity bug report too. However, when running apport-collect on an apport bug report a report is created without a ProblemType it just is not checked for anything so the process doesn't crash.

Anyway, this pretty seriously impacts the usability of apport-collect.

summary: - apport-collect with debian-installer doesn't create a ProblemType in the
- report
+ apport-collect doesn't create a ProblemType in the report
Changed in apport:
status: New → Triaged
Changed in apport (Ubuntu):
status: New → Triaged
importance: Undecided → High
Brian Murray (brian-murray) wrote :

For some reason the ProblemType is being removed from the report, causing package hooks or the ubuntu general hook which expect it to fail. This'll fix the bug.

 $ bzr diff apport/ui.py
=== modified file 'apport/ui.py'
--- apport/ui.py 2018-02-14 18:10:19 +0000
+++ apport/ui.py 2018-04-27 15:55:37 +0000
@@ -559,7 +559,6 @@
         self.add_extra_tags()

         # delete the uninteresting keys
- del self.report['ProblemType']
         del self.report['Date']
         try:
             del self.report['SourcePackage']

tags: added: id-5ae342df130f377143f72804
tags: added: id-5ae35ea55ac10e9203cade8d
Changed in apport:
status: Triaged → Fix Released
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.20.10-0ubuntu1) cosmic; urgency=medium

  * New upstream release:
    - backends/packaging-apt-dpkg.py: when using a permanent sandbox better
      check for the package being already available thereby reducing quantity
      of downloads.
    - apport/report.py: Use timeout parameter in subprocess to limit how long
      we'll wait for gdb to return information as gdb can hang with some core
      files.
    - data/apport: Fix PEP8 issues
    - apport/ui.py: Include ProblemType in reports which are updated as
      package hooks may expect the report to have a ProblemType. (LP: #1766794)
    - test/test_ui.py: modify run_crash_kernel test to account for the fact
      that linux-image-$kvers-$flavor is now built from the linux-signed
      source package on amd64 and ppc64el. (LP: #1766740)
  * data/general-hooks/ubuntu.py: Fix UnicodeDecodeError when processing
    DpkgTerminalLog. (LP: #1766337)
  * data/general-hooks/ubuntu.py: Don't display a messy error if python or
    python3 is not installed. (LP: #1769262)
  * debian/apport.links: source_linux-signed.py -> source_linux.py package
    hook (LP: #1766740)
  * data/package-hooks/source_linux.py: Redirect bugs filed about the
    linux-signed source package to linux. (LP: #1766740)

 -- Brian Murray <email address hidden> Thu, 10 May 2018 09:31:34 -0700

Changed in apport (Ubuntu):
status: Triaged → Fix Released
Changed in apport (Ubuntu Bionic):
status: Triaged → In Progress
assignee: nobody → Brian Murray (brian-murray)
description: updated

Hello John, or anyone else affected,

Accepted apport into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.9-0ubuntu7.2 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 on 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

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

Changed in apport (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Brian Murray (brian-murray) wrote :

I installed apport version 2.20.9-0ubuntu7.2 and did not receive a Traceback when using apport-collect to update an ubuntu-release-upgrader bug report. I did however receive the following error message since apport doesn't seem to support using apport-collect with a source package name, but that is a separate issue.

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.7 KB)
  V: View report
  K: Keep report file for sending later or copying to somewhere else
  I: Cancel and ignore future crashes of this program version
  C: Cancel
Please choose (S/V/K/I/C): v

*** Collecting problem information

The collected information can be sent to the developers to improve the
application. This might take a few minutes.
dpkg-query: no packages found matching ubuntu-release-upgrader
.

*** Error: Invalid problem report

Could not determine the package or source package name.

Press any key to continue...

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.9-0ubuntu7.2

---------------
apport (2.20.9-0ubuntu7.2) bionic; urgency=medium

  * apport/ui.py: Include ProblemType in reports which are updated as
    package hooks may expect the report to have a ProblemType. (LP: #1766794)
  * test/test_ui.py: modify run_crash_kernel test to account for the fact
    that linux-image-$kvers-$flavor is now built from the linux-signed
    source package on amd64 and ppc64el. (LP: #1766740)
  * data/general-hooks/ubuntu.py: Don't display a messy error if python or
    python3 is not installed. (LP: #1769262)
  * debian/apport.links: source_linux-signed.py -> source_linux.py package
    hook (LP: #1773012)
  * data/package-hooks/source_linux.py: Redirect bugs filed about the
    linux-signed source package to linux. (LP: #1773012)

 -- Brian Murray <email address hidden> Wed, 30 May 2018 15:19:49 -0700

Changed in apport (Ubuntu Bionic):
status: Fix Committed → Fix 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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers