Snap of apport - an Ubuntu package for automatic crash reporting

I wanted to make it known that I’ve created an initial snap of apport. There is still more work to be done to make it more widely useful, but I’d like to get the community’s input on the status so far. For information on other work already planned for this snap see the blueprint.

That being said, it is currently installable by using ‘snap install --channel beta --devmode apport’. The snap will create barebones reports for any application (snap or package in the core system) which crashes. The reports will be stored in /var/snap/apport/common/crash. Currently, a report will need to be updated using apport-cli, included in the snap, like so:

sudo apport.apport-cli /var/snap/apport/common/crash/_usr_sbin_sshd.0.crash

I’m still working out some details of creating the Package field in the report, but in the example above one could add “Package: openssh-server 1:7.2p2-4ubuntu2.1” to the crash file and have a report which could be retraced from an Ubuntu system with apport installed. At this point in time whoopsie is not integrated and the crashes will not be sent to the Ubuntu Error Tracker.

If you install the snap I’m interested to hear any feedback and about any crash reports you find in the crash directory.

4 Likes

What do you mean by this? I’m not familiar enough with apport but I’m installing your Snap because I need to get a crash report if LibreOffice crashes again (crashed twice on me in the last couple of days, doubt it’s a regression in core revision 1689 (Beta) it’s probably just that I’m using Impress and Writer and working with the two which I haven’t done with the Snap before - but I still need to file a bug).

When the crash is detected a minimal report is created, but it is missing some information which is added when the ‘apport-cli’ command I referenced is used. For example, the version of the apport snap being used is gathered, the kernel version, and the list of packages and versions in the Ubuntu Core image. All of this information makes for a more complete report which can help developers debug the issue.

Right. I tried to use sudo apport.apport-cli PID (replacing PID with the actual PID number) when LibreOffice crashed again but it said it couldn’t report because it’s a Snap (literally said something like because it’s Ubuntu Core)? I looked in the /var/snap/apport/current/crash directory but found nothing.

I guess it’s because I need a ‘package name’ for the Snap or something and then I should use sudo apport.apport-cli /var/snap/apport/current/crash/libreoffice.crash or whatever it is?

Right. I tried to use sudo apport.apport-cli PID (replacing PID with
the actual PID number) when LibreOffice crashed again but it said it
couldn’t report because it’s a Snap (literally said something like
because it’s Ubuntu Core)?

I haven’t tried using a PID number myself - I’ll give that a try.

I looked in the /var/snap/apport/current/crash directory but found
nothing.

Could you have a look at apport’s log file “/var/log/apport.log” and see
if there is anything about your LibreOffice crash there?

I guess it’s because I need a ‘package name’ for the Snap or something
and then I should use sudo apport.apport-cli /var/snap/apport/current/crash/libreoffice.crash or whatever it is?

Yes, you should use the path to the .crash file when one exists.

There’s nothing about the crash there.

(Really could do with reporting this since it also somehow manages to freeze everything apart from the cursor and I can still load a Terminal with the keyboard and type in that but that’s about it! Only after I kill it after finding out the PID with top stuff unfreezes. But ideally I need a crash report of some sort to attach to it.)

Ah cool cheers

Managed to screenshot it while most things are frozen. ARGH! At least it happens regularly (although unreliably) enough for me to submit a crash report when I’m able to (and to test the Apport Snap)…

I’ve changed the directory where crash reports are stored from /var/snap/apport/current to /var/snap/apport/common so that the crash files will persist across versions of the apport snap.

Additionally, the version of apport in the edge channel now will add the Package field automatically to the crash report when apport.cli (notice I changed the name of the command too) is ran.