zfsutils-linux fails to install if `modprobe zfs` fails

Bug #1880421 reported by Simon Déziel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
Fix Released
Medium
Colin Ian King
Focal
Fix Released
Undecided
Unassigned
Groovy
Fix Released
Medium
Colin Ian King

Bug Description

== SRU Justification, Focal ==

Justification: Installing zfsutils with zfs modules not available causes the package to installation to fail. The package should install cleanly rather than break.

== Test Case ==

# Prevent module loading
$ sudo sysctl kernel.modules_disabled=1

# Install the package
$ sudo apt install -y zfsutils-linux

This should succeed. Without the fix this fails. (See below for the failure message). With the fix modules don't install but the package install succeeds.

== Regression Potential ==

There may be users who expect the package to fail to install when the zfs utils fail to install when the modules are not available. However, this is a corner case where users are expecting broken behaviour to occur and should not be relying on this.

The changes to the systemd rules are already in Ubuntu groovy and have been tested, so I believe the regression potential is limited.

----

Description:

When installing zfsutils-linux, failure to `modprobe zfs` cause the package installation to fail.
Ideally, modprobe should be attempted but not fatal.

Steps to reproduce:

# Prevent module loading
$ sudo sysctl kernel.modules_disabled=1

# Install the package
$ sudo apt install -y zfsutils-linux

This should succeed but fails with:

Reading package lists... Done
Building dependency tree
Reading state information... Done
zfsutils-linux is already the newest version (0.8.3-1ubuntu12).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up zfsutils-linux (0.8.3-1ubuntu12) ...
insmod /lib/modules/5.4.0-31-generic/kernel/zfs/zlua.ko
modprobe: ERROR: could not insert 'zfs': Operation not permitted
zfs-import-scan.service is a disabled or a static unit, not starting it.
A dependency job for zfs-import-cache.service failed. See 'journalctl -xe' for details.
Job for zfs-load-module.service failed because the control process exited with error code.
See "systemctl status zfs-load-module.service" and "journalctl -xe" for details.
zfs-import-scan.service is a disabled or a static unit, not starting it.
Job for zfs-load-module.service failed because the control process exited with error code.
See "systemctl status zfs-load-module.service" and "journalctl -xe" for details.
A dependency job for zfs-import-cache.service failed. See 'journalctl -xe' for details.
Job for zfs-share.service failed because the control process exited with error code.
See "systemctl status zfs-share.service" and "journalctl -xe" for details.
invoke-rc.d: initscript zfs-share, action "start" failed.
● zfs-share.service - ZFS file system shares
     Loaded: loaded (/lib/systemd/system/zfs-share.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-05-24 16:56:03 UTC; 52ms ago
       Docs: man:zfs(8)
    Process: 9283 ExecStartPre=/bin/rm -f /etc/dfs/sharetab (code=exited, status=0/SUCCESS)
    Process: 9284 ExecStart=/sbin/zfs share -a (code=exited, status=1/FAILURE)
   Main PID: 9284 (code=exited, status=1/FAILURE)

May 24 16:56:03 ocelot systemd[1]: Starting ZFS file system shares...
May 24 16:56:03 ocelot zfs[9284]: The ZFS modules are not loaded.
May 24 16:56:03 ocelot zfs[9284]: Try running '/sbin/modprobe zfs' as root to load them.
May 24 16:56:03 ocelot systemd[1]: zfs-share.service: Main process exited, code=exited, status=1/FAILURE
May 24 16:56:03 ocelot systemd[1]: zfs-share.service: Failed with result 'exit-code'.
May 24 16:56:03 ocelot systemd[1]: Failed to start ZFS file system shares.
dpkg: error processing package zfsutils-linux (--configure):
 installed zfsutils-linux package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of zfs-zed:
 zfs-zed depends on zfsutils-linux (>= 0.8.3-1ubuntu12); however:
  Package zfsutils-linux is not configured yet.

dpkg: error processing package zfs-zed (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 zfsutils-linux
 zfs-zed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Additional information:

$ lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04

$ apt-cache policy zfsutils-linux
zfsutils-linux:
  Installed: 0.8.3-1ubuntu12
  Candidate: 0.8.3-1ubuntu12
  Version table:
 *** 0.8.3-1ubuntu12 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Changed in zfs-linux (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Colin Ian King (colin-king)
status: New → In Progress
Changed in zfs-linux (Ubuntu Focal):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zfs-linux - 0.8.4-1ubuntu4

---------------
zfs-linux (0.8.4-1ubuntu4) groovy; urgency=medium

  * Don't report errors if modprobe fails (LP: #1880421)
    - loading ZFS modules on zfs-utils installation is a nice
      to have feature, but don't throw an error if modules are
      not available to load

 -- Colin Ian King <email address hidden> Thu, 4 Jun 2020 13:54:54 +0100

Changed in zfs-linux (Ubuntu Groovy):
status: In Progress → Fix Released
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Simon, or anyone else affected,

Accepted zfs-linux into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zfs-linux/0.8.3-1ubuntu12.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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 zfs-linux (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Colin Ian King (colin-king) wrote :

Testing -proposed spl:

Tested: spl now builds fine on 4.15, 5.3 and 5.4 kernels
Tested: ubuntu ZFS autotest smoke and fs on kernels:
   5.4 - OK
   5.3 - OK
   4.15 - OK

Looks good to me.

tags: added: verification-done-bionic
tags: removed: verification-done-bionic
Revision history for this message
Colin Ian King (colin-king) wrote :

Ignore comment above, wrong bug!

Revision history for this message
Colin Ian King (colin-king) wrote :

Set: sudo sysctl kernel.modules_disabled=1
Installed -proposed zfsutils-linux, no breakage now. Issue is fixed.

tags: added: verification-done-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zfs-linux - 0.8.3-1ubuntu12.2

---------------
zfs-linux (0.8.3-1ubuntu12.2) focal; urgency=medium

  * Don't report errors if modprobe fails (LP: #1880421)
    - 4510-silently-ignore-modprobe-failure.patch
      loading ZFS modules on zfs-utils installation is a nice
      to have feature, but don't throw an error if modules are
      not available to load

 -- Colin Ian King <email address hidden> Mon, 6 Jul 2020 12:13:15 +0100

Changed in zfs-linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for zfs-linux has completed successfully and the package is now being 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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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