zfs-mount.service and others fail inside unpriv containers

Bug #1862661 reported by Ryan Harper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

1)
# lsb_release -rd
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04

2)
# apt-cache policy zfsutils-linux
zfsutils-linux:
  Installed: (none)
  Candidate: 0.8.3-1ubuntu3
  Version table:
     0.8.3-1ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

3) apt install zfsutils-linux installs successfully
4) apt install zfsutils-linux; echo $? == 0
installs but apt returns error code due to zfs services failing to start successfully

See "systemctl status zfs-mount.service" and "journalctl -xe" for details.
invoke-rc.d: initscript zfs-mount, action "start" failed.
● zfs-mount.service - Mount ZFS filesystems
     Loaded: loaded (]8;;file://f2/lib/systemd/system/zfs-mount.service/lib/systemd/system/zfs-mount.service]8;;; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2020-02-10 16:18:04 UTC; 23ms ago
       Docs: ]8;;man:zfs(8)man:zfs(8)]8;;
    Process: 1672 ExecStart=/sbin/zfs mount -a (code=exited, status=1/FAILURE)
   Main PID: 1672 (code=exited, status=1/FAILURE)

Feb 10 16:18:04 f2 systemd[1]: Starting Mount ZFS filesystems...
Feb 10 16:18:04 f2 zfs[1672]: /dev/zfs and /proc/self/mounts are required.
Feb 10 16:18:04 f2 zfs[1672]: Try running 'udevadm trigger' and 'mount -t proc proc /proc' as root.
Feb 10 16:18:04 f2 systemd[1]: zfs-mount.service: Main process exited, code=exited, status=1/FAILURE
Feb 10 16:18:04 f2 systemd[1]: zfs-mount.service: Failed with result 'exit-code'.
Feb 10 16:18:04 f2 systemd[1]: Failed to start Mount ZFS filesystems.

I'm inside a LXD unpriv container. By default, there are no permissions to mount proc, modprobe modules, etc.

E: Sub-process /usr/bin/dpkg returned an error code (1)
100

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: zfsutils-linux 0.8.3-1ubuntu3
ProcVersionSignature: Ubuntu 5.4.0-9.12-generic 5.4.3
Uname: Linux 5.4.0-9-generic x86_64
ApportVersion: 2.20.11-0ubuntu16
Architecture: amd64
Date: Mon Feb 10 15:50:42 2020
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=C.UTF-8
SourcePackage: zfs-linux
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ryan Harper (raharper) wrote :
Richard Laager (rlaager)
Changed in zfs-linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Ryan Harper (raharper) wrote :
Download full text (5.5 KiB)

Note, the fact that these services fail isn't new; they've failed for a long time. However, reporting the service failure to apt is new. For example of bionic, we don't see an apt error:

# lsb_release -rd
Description: Ubuntu 18.04.4 LTS
Release: 18.04

# apt-cache policy zfsutils-linux
zfsutils-linux:
  Installed: 0.7.5-1ubuntu16.7
  Candidate: 0.7.5-1ubuntu16.7
  Version table:
 *** 0.7.5-1ubuntu16.7 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.7.5-1ubuntu15 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

# apt install zfsutils-linux
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-zed
Suggested packages:
  zfs-modules | zfs-dkms nfs-kernel-server samba-common-bin zfs-initramfs | zfs-dracut
The following NEW packages will be installed:
  libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-zed zfsutils-linux
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 1168 kB of archives.
After this operation, 4259 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnvpair1linux amd64 0.7.5-1ubuntu16.7 [45.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libuutil1linux amd64 0.7.5-1ubuntu16.7 [48.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libzpool2linux amd64 0.7.5-1ubuntu16.7 [547 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libzfs2linux amd64 0.7.5-1ubuntu16.7 [128 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 zfsutils-linux amd64 0.7.5-1ubuntu16.7 [342 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 zfs-zed amd64 0.7.5-1ubuntu16.7 [57.7 kB]
Fetched 1168 kB in 1s (1972 kB/s)
Selecting previously unselected package libnvpair1linux.
(Reading database ... 28654 files and directories currently installed.)
Preparing to unpack .../0-libnvpair1linux_0.7.5-1ubuntu16.7_amd64.deb ...
Unpacking libnvpair1linux (0.7.5-1ubuntu16.7) ...
Selecting previously unselected package libuutil1linux.
Preparing to unpack .../1-libuutil1linux_0.7.5-1ubuntu16.7_amd64.deb ...
Unpacking libuutil1linux (0.7.5-1ubuntu16.7) ...
Selecting previously unselected package libzpool2linux.
Preparing to unpack .../2-libzpool2linux_0.7.5-1ubuntu16.7_amd64.deb ...
Unpacking libzpool2linux (0.7.5-1ubuntu16.7) ...
Selecting previously unselected package libzfs2linux.
Preparing to unpack .../3-libzfs2linux_0.7.5-1ubuntu16.7_amd64.deb ...
Unpacking libzfs2linux (0.7.5-1ubuntu16.7) ...
Selecting previously unselected package zfsutils-linux.
Preparing to unpack .../4-zfsutils-linux_0.7.5-1ubuntu16.7_amd64.deb ...
Unpacking zfsutils-linux (0.7.5-1ubuntu16.7) ...
Selecting previously unselected package zfs-zed.
Preparing to unpack .../5-zfs-zed_0.7.5-1ubuntu16...

Read more...

description: updated
Revision history for this message
Richard Laager (rlaager) wrote :

What was the expected result? Are you expecting to be able to just install ZFS in a container (but not use it)? Or are you expecting it to actually work? The user space tools can’t do much of anything without talking to the kernel.

Revision history for this message
Ryan Harper (raharper) wrote :

The latter; This may only be a packaging issue in that bionic release of tools don't report an error up through apt, where in focal (and eoan) report an error to apt.

Changed in zfs-linux (Ubuntu):
status: Incomplete → New
Revision history for this message
Ryan Harper (raharper) wrote :

Sorry, I do not expect the zfs tools to function inside the unpriv container. There is some packaging change between previous releases which did not report an error to apt/dpkg when installing.

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.