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

Bug #1766794 reported by John George on 2018-04-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
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/ crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/", line 198, in _run_hook
    symb['add_info'](report, ui)
  File "/usr/share/apport/general-hooks/", line 90, in add_info
    if report['ProblemType'] == 'Crash':
  File "/usr/lib/python3.6/collections/", 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/
=== modified file 'apport/'
--- apport/ 2018-02-14 18:10:19 +0000
+++ apport/ 2018-04-27 15:55:37 +0000
@@ -559,7 +559,6 @@

         # delete the uninteresting keys
- del['ProblemType']

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/ when using a permanent sandbox better
      check for the package being already available thereby reducing quantity
      of downloads.
    - apport/ Use timeout parameter in subprocess to limit how long
      we'll wait for gdb to return information as gdb can hang with some core
    - data/apport: Fix PEP8 issues
    - apport/ Include ProblemType in reports which are updated as
      package hooks may expect the report to have a ProblemType. (LP: #1766794)
    - test/ 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/ Fix UnicodeDecodeError when processing
    DpkgTerminalLog. (LP: #1766337)
  * data/general-hooks/ Don't display a messy error if python or
    python3 is not installed. (LP: #1769262)
  * debian/apport.links: -> package
    hook (LP: #1766740)
  * data/package-hooks/ 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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers