ubuntu-bug with program path says as a snap does not belong to a package

Bug #1760220 reported by Brian Murray on 2018-03-30
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
High
Brian Murray
Bionic
Low
Brian Murray
Cosmic
Low
Brian Murray

Bug Description

[Impact]
ubuntu-bug responds with a misleading statement asked to report a bug about an executable path which starts with /snap/bin and the response is different than if you were to use the snap name e.g. ubuntu-bug juju

[Test Case]
1) Run ubuntu-bug /snap/bin/juju
2) Read "/snap/bin/juju does not belong to a package"

With the version of apport in -proposed you'll receive a more informative message about where you might get help regarding the issue you are experiencing.

[Regression Potential]
The new code only affects executables that start with '/snap/bin' so the only danger is if the newly added code contains an error which would cause a traceback.

Original Report
---------------
apport's ui.py file contains the following code:

 809 # executable?
 810 elif '/' in self.args[0]:
 811 pkg = apport.packaging.get_file_package(self.args[0])
 812 if not pkg:
 813 optparser.error('%s does not belong to a package.' % self.args[0])
 814 sys.exit(1)
 815 self.args = []
 816 self.options.filebug = True
 817 self.options.package = pkg

This will not provide any useful information about what to do if the 'executable' is provided by a snap. Information similar to https://code.launchpad.net/~juliank/ubuntu/bionic/apport/snap/+merge/342207 should be provided if the path is from a snap.

tags: added: bionic snaps
tags: added: id-5abea8119060195b844876ec
Changed in apport (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.20.10-0ubuntu14) disco; urgency=medium

  * apport/ui.py: when using ubuntu-bug properly handle executables which
    start with /snap/bin. (LP: #1760220)

 -- Brian Murray <email address hidden> Thu, 01 Nov 2018 09:30:11 -0700

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

Hello Brian, or anyone else affected,

Accepted apport into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apport/2.20.10-0ubuntu13.1 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-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

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

This works as expected on cosmic.

 $ apt-cache policy apport
apport:
  Installed: 2.20.10-0ubuntu13
  Candidate: 2.20.10-0ubuntu13.1
  Version table:
     2.20.10-0ubuntu13.1 500
        500 http://ubuntu.osuosl.org/ubuntu cosmic-proposed/main amd64 Packages
        500 http://ubuntu.osuosl.org/ubuntu cosmic-proposed/main i386 Packages
 *** 2.20.10-0ubuntu13 500
        500 http://192.168.10.7/ubuntu cosmic/main amd64 Packages
        500 http://192.168.10.7/ubuntu cosmic/main i386 Packages
        100 /var/lib/dpkg/status
[ 11:45AM 10233 ] [ bdmurray@speedy:~/source-trees/ubuntu-archive-tools/upstream ]
 $ ubuntu-bug /snap/bin/juju
Usage: ubuntu-bug [options] [symptom|pid|package|program path|.apport/.crash file]

ubuntu-bug: error: /snap/bin/juju is provided by a snap published by canonical. Contact them via http://jujucharms.com for help.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Steve Langasek (vorlon) wrote :

Hello Brian, 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.5 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

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

This also works as intended on Ubuntu 18.04.

bdmurray@clean-bionic-amd64:~$ ubuntu-bug /snap/bin/juju
Usage: ubuntu-bug [options] [symptom|pid|package|program path|.apport/.crash file]

ubuntu-bug: error: /snap/bin/juju does not belong to a package.
bdmurray@clean-bionic-amd64:~$ sudo apt install apport-gtk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  python3-apport
The following packages will be upgraded:
  apport-gtk python3-apport
2 upgraded, 0 newly installed, 0 to remove and 270 not upgraded.
Need to get 91.4 kB of archives.
After this operation, 6,144 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 python3-apport all 2.20.9-0ubuntu7.5 [81.6 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 apport-gtk all 2.20.9-0ubuntu7.5 [9,704 B]
Fetched 91.4 kB in 1s (98.0 kB/s)
(Reading database ... 166001 files and directories currently installed.)
Preparing to unpack .../python3-apport_2.20.9-0ubuntu7.5_all.deb ...
Unpacking python3-apport (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.2) ...
Preparing to unpack .../apport-gtk_2.20.9-0ubuntu7.5_all.deb ...
Unpacking apport-gtk (2.20.9-0ubuntu7.5) over (2.20.9-0ubuntu7.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...
Setting up python3-apport (2.20.9-0ubuntu7.5) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Setting up apport-gtk (2.20.9-0ubuntu7.5) ...
bdmurray@clean-bionic-amd64:~$ ubuntu-bug /snap/bin/juju
Usage: ubuntu-bug [options] [symptom|pid|package|program path|.apport/.crash file]

ubuntu-bug: error: /snap/bin/juju is provided by a snap. No contact address has been provided; visit the forum at https://forum.snapcraft.io/ for help.

tags: added: verification-done-bionic
removed: verification-needed-bionic

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.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.10-0ubuntu13.1

---------------
apport (2.20.10-0ubuntu13.1) cosmic; urgency=medium

  * apport/ui.py: when using ubuntu-bug properly handle executables which
    start with /snap/bin. (LP: #1760220)

 -- Brian Murray <email address hidden> Thu, 01 Nov 2018 09:29:24 -0700

Changed in apport (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

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

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

  * apport/ui.py: when using ubuntu-bug properly handle executables which
    start with /snap/bin. (LP: #1760220)
  * test/test_ui_gtk.py: Increase the timeout so that when the autopkgtest
    infrastructure is busy the tests should not fail. (LP: #1780767)

 -- Brian Murray <email address hidden> Fri, 02 Nov 2018 08:19:37 -0700

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

Other bug subscribers