dkms_packages.py supported kernel check is not working

Bug #1588479 reported by Brian Murray
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Fix Released
Medium
Brian Murray
Trusty
Fix Released
Medium
Brian Murray
Xenial
Fix Released
Medium
Brian Murray
Yakkety
Fix Released
Medium
Brian Murray

Bug Description

Test Case
---------
1) Look for some dkms package in /usr/src e.g. bbswitch-0.8
2) Run python3 /usr/share/apport/package-hooks/dkms_packages.py -m bbswitch -v 0.8 -k 4.6.1-01234-lowlatency
3) Observe a crash report dialog from apport for bbswitch

With the version of apport from -proposed you will instead receive:

ERROR (dkms apport): kernel package linux-headers-4.6.1-01234-lowlatency is not supported

The apport package hook for dkms packages seems to have an error in its supported kernel check. If the kernel is an unsupported one, the hook should exit with a return code of 1. However, in the Ubuntu Error Tracker we can see some crashes with unsupported kernel versions e.g.:

https://errors.ubuntu.com/oops/2733d742-284e-11e6-a745-fa163e839e11
DKMSKernelVersion: 4.6.1-040601-lowlatency

https://errors.ubuntu.com/oops/0a1afefc-253c-11e6-9082-fa163e192766
DKMSKernelVersion: 4.6.0-040600-lowlatency

If the intent really is to block creation of these reports, then let's do that.

tags: added: xenial
tags: added: rls-y-incoming
Revision history for this message
Brian Murray (brian-murray) wrote :

The issue is the ValueError string content changed or was never correct.

*** ValueError: package linux-headers-4.6.1-040601-lowlatency does not exist

vs.

    try:
        supported_kernel = apport.packaging.is_distro_package(kernel_package)
    except ValueError as e:
        if str(e) == 'package does not exist':
            supported_kernel = False

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

Well, it changed in 2012...

 $ bzr log -r 1369.34.701 -p
------------------------------------------------------------
revno: 1369.34.701
committer: Martin Pitt <email address hidden>
branch nick: apport
timestamp: Tue 2012-09-18 12:12:33 +0200
message:
  * packaging-apt-dpkg.py: When throwing ValueErrors, show the non-existing package name. This makes it easier to debug such crashes.
diff:
=== modified file 'NEWS'
--- NEWS 2012-09-18 09:15:59 +0000
+++ NEWS 2012-09-18 10:12:33 +0000
@@ -4,6 +4,8 @@
 2.5.3 (UNRELEASED):
 -------------------
  * data/apportcheckresume: Open report file in binary mode. (LP: #1040353)
+ * packaging-apt-dpkg.py: When throwing ValueErrors, show the non-existing
+ package name. This makes it easier to debug such crashes.

 2.5.2 (2012-09-17):
 -------------------

=== modified file 'backends/packaging-apt-dpkg.py'
--- backends/packaging-apt-dpkg.py 2012-08-24 05:27:31 +0000
+++ backends/packaging-apt-dpkg.py 2012-09-18 10:12:33 +0000
@@ -112,7 +112,7 @@
         try:
             return self._cache()[package]
         except KeyError:
- raise ValueError('package does not exist')
+ raise ValueError('package %s does not exist' % package)

     def get_version(self, package):
         '''Return the installed version of a package.'''
@@ -120,7 +120,7 @@
         pkg = self._apt_pkg(package)
         inst = pkg.installed
         if not inst:
- raise ValueError('package does not exist')
+ raise ValueError('package %s does not exist' % package)
         return inst.version

     def get_available_version(self, package):

Changed in dkms (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
summary: - dkms_packages.py supported kernel check seems wrong
+ dkms_packages.py supported kernel check is wrong
summary: - dkms_packages.py supported kernel check is wrong
+ dkms_packages.py supported kernel check is not working
description: updated
Changed in dkms (Ubuntu Xenial):
status: New → In Progress
Changed in dkms (Ubuntu Yakkety):
status: Triaged → In Progress
Changed in dkms (Ubuntu Trusty):
status: New → In Progress
assignee: nobody → Brian Murray (brian-murray)
Changed in dkms (Ubuntu Xenial):
assignee: nobody → Brian Murray (brian-murray)
Changed in dkms (Ubuntu Trusty):
importance: Undecided → Medium
Changed in dkms (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.2.0.3-2ubuntu14

---------------
dkms (2.2.0.3-2ubuntu14) yakkety; urgency=medium

  * apport_name_in_valueerror.diff: (LP: #1588479)
    - Check the ValueError from apport for the package name too, this prevents
      reporting of dkms crashes about unsupported kernels.

 -- Brian Murray <email address hidden> Thu, 15 Sep 2016 13:46:49 -0700

Changed in dkms (Ubuntu Yakkety):
status: In Progress → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted dkms into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/dkms/2.2.0.3-2ubuntu11.3 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 dkms (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in dkms (Ubuntu Trusty):
status: In Progress → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Brian, or anyone else affected,

Accepted dkms into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/dkms/2.2.0.3-1.1ubuntu5.14.04.9 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!

Revision history for this message
Andy Whitcroft (apw) wrote :

@Brian -- are we going to get verification for this fix soon?

Note to reviewers the "new" ADT tests for nvidia-* are not related to this update.

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

Done for xenial:

[ 9:26AM 17170 ] [ bdmurray@impulse:~ ]
 $ sudo apt-get install dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic linux-image-4.4.0-34-generic linux-image-extra-4.4.0-34-generic linux-tools-4.4.0-34 linux-tools-4.4.0-34-generic python3-requests-oauthlib
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  dkms
1 upgraded, 0 newly installed, 0 to remove and 190 not upgraded.
Need to get 66.1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 dkms all 2.2.0.3-2ubuntu11.3 [66.1 kB]
Fetched 66.1 kB in 0s (104 kB/s)
Sorry, your system lacks support for the snapshot feature
Reading changelogs... Done
(Reading database ... 918737 files and directories currently installed.)
Preparing to unpack .../dkms_2.2.0.3-2ubuntu11.3_all.deb ...
Unpacking dkms (2.2.0.3-2ubuntu11.3) over (2.2.0.3-2ubuntu11.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up dkms (2.2.0.3-2ubuntu11.3) ...
[ 9:26AM 17171 ] [ bdmurray@impulse:~ ]
 $ python3 /usr/share/apport/package-hooks/dkms_packages.py -m bbswitch -v 0.8 -k 4.6.1-01234-lowlatency
ERROR (dkms apport): kernel package linux-headers-4.6.1-01234-lowlatency is not supported

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

Verified for Trusty too:

Setting up dkms (2.2.0.3-1.1ubuntu5.14.04.9) ...
bdmurray@upgrade-trusty-amd64:~$ python3 /usr/share/apport/package-hooks/dkms_packages.py -m bbswitch -v 0.7 -k 4.6.1-01234-lowlatency
ERROR (dkms apport): kernel package linux-headers-4.6.1-01234-lowlatency is not supported

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for dkms 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 dkms - 2.2.0.3-1.1ubuntu5.14.04.9

---------------
dkms (2.2.0.3-1.1ubuntu5.14.04.9) trusty; urgency=medium

  * apport_name_in_valueerror.diff: (LP: #1588479)
    - Check the ValueError from apport for the package name too, this prevents
      reporting of dkms crashes about unsupported kernels.

 -- Brian Murray <email address hidden> Thu, 15 Sep 2016 14:25:09 -0700

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

This bug was fixed in the package dkms - 2.2.0.3-2ubuntu11.3

---------------
dkms (2.2.0.3-2ubuntu11.3) xenial; urgency=medium

  * apport_name_in_valueerror.diff: (LP: #1588479)
    - Check the ValueError from apport for the package name too, this prevents
      reporting of dkms crashes about unsupported kernels.

 -- Brian Murray <email address hidden> Thu, 15 Sep 2016 14:22:14 -0700

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

Other bug subscribers

Remote bug watches

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