zsys package post-installation failed when boot pool is not imported

Bug #1886214 reported by Patrick Gray
112
This bug affects 21 people
Affects Status Importance Assigned to Milestone
zsys (Ubuntu)
Fix Released
High
Jean-Baptiste Lallement
Focal
Fix Released
High
Jean-Baptiste Lallement

Bug Description

** SRU **
[Impact]
For yet unknown reasons, bpool is sometimes not imported. This causes the upgrade script to fail because then /boot is not a mount point.
The fix just ignores the return status of findmnt to prevent the postinst script to fail in this situation

[Test Case]
1. Install zsys 0.4.5
2. Unmount /boot/grub/, /boot/efi and /boot
3. Install the update of zsys

[Regression potential]
Low, since now the error is now ignored.

** Original Description **
root@tmp:/home/pgray# zfs list -t snapshot -o name -S creation
no datasets available

root@tmp:/home/pgray# sudo apt-get install zsys
Reading package lists... Done
Building dependency tree
Reading state information... Done
zsys is already the newest version (0.4.6).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Requesting to save current system state
Successfully saved as "autozsys_90843v"
Setting up zsys (0.4.6) ...
dpkg: error processing package zsys (--configure):
 installed zsys package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 zsys
ZSys is adding automatic system snapshot to GRUB menu
ERROR Service took too long to respond. Disconnecting client.
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@tmp:/home/pgray# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
rpool 107G 9.27G 97.7G - - 10% 8% 1.00x ONLINE -

This was after a previous upgrade failed.
Even after removing all snapshots for that pool, it fails.

root@tmp:/home/pgray# lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04

root@tmp:/home/pgray# apt-cache policy zsys
zsys:
  Installed: 0.4.6
  Candidate: 0.4.6
  Version table:
 *** 0.4.6 500
        500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.4.5 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.3
Architecture: amd64
CasperMD5CheckResult: skip
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2020-06-09 (27 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
Package: zsys 0.4.5
PackageArchitecture: amd64
ProcEnviron:
 TERM=screen-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/BOOT/ubuntu_bgiwia@/vmlinuz-5.4.0-37-generic root=ZFS=rpool/ROOT/ubuntu_bgiwia ro quiet splash
ProcVersionSignature: Ubuntu 5.4.0-37.41-generic 5.4.41
RelatedPackageVersions:
 zfs-initramfs 0.8.3-1ubuntu12.1
 zfsutils-linux 0.8.3-1ubuntu12.1
Tags: focal
Uname: Linux 5.4.0-37-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip docker kvm libvirt lpadmin lxd plugdev sambashare sudo
ZFSImportedPools:
 NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
 rpool 107G 9.66G 97.3G - - 10% 9% 1.00x ONLINE -
 slow 29.1T 606G 28.5T - - 0% 2% 1.00x ONLINE -
ZFSListcache-bpool:
 bpool /boot off on on off on off on off - none
 bpool/BOOT none off on on off on off on off - none
 bpool/BOOT/ubuntu_bgiwia /boot on on on off on off on off - none
_MarkForUpload: True

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zsys (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Could you please run:
apport-collect 1886214

It will gather useful information that will help us understand why the upgrade failed.

Thanks.

Changed in zsys (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Patrick Gray (patgray1127) wrote : Dependencies.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
Patrick Gray (patgray1127) wrote : Grub.cfg.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : Mounts.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : MountsGenerated.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : SystemdDefaultUnitsState.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : SystemdFailedUnits.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSDatasets.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSListcache-rpool.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSModules.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSMounts.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSPoolCache.gz

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZFSPoolsStatus.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZSYSDump.txt

apport information

Revision history for this message
Patrick Gray (patgray1127) wrote : ZSYSJournal.txt

apport information

Changed in zsys (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote : Re: apt-get upgrade fails on zsys package when boot pool is not imported

Thanks for the data.

for some reason bpool is not imported on your system, and the postinst script fails in this case.

summary: - apt-get upgrade fails on zsys package
+ apt-get upgrade fails on zsys package when boot pool is not imported
Changed in zsys (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
summary: - apt-get upgrade fails on zsys package when boot pool is not imported
+ zsys package post-installation failed when boot pool is not imported
Revision history for this message
daxm (daxm) wrote :

I too see "ERROR Service took too long to respond. Disconnecting client." when I use apt.

Revision history for this message
Norbert Nord (nor500) wrote :

Everytime I try to install something the end is: Errors were encountered while processing:
 zsys
ZSys is adding automatic system snapshot to GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)

Very annoying! How can I correct this?

Revision history for this message
dksdk (dksdk) wrote :

Setting up zsys (0.4.6) ...
dpkg: error processing package zsys (--configure):
 installed zsys package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Errors were encountered while processing:
 zsys
ZSys is adding automatic system snapshot to GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)

affects me as well with this output.

Revision history for this message
Patrick Gray (patgray1127) wrote :

Anything else I can provide here?
This zfs-root was setup by the ubuntu desktop installer fwiw.

Revision history for this message
gbear14275 (gbear14275) wrote :

Is there any workaround or mitigation? Re-installation, etc?

Revision history for this message
gbear14275 (gbear14275) wrote :
Changed in zsys (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Changed in zsys (Ubuntu):
assignee: nobody → Jean-Baptiste Lallement (jibel)
Changed in zsys (Ubuntu Focal):
assignee: nobody → Jean-Baptiste Lallement (jibel)
milestone: none → focal-updates
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zsys - 0.5.1

---------------
zsys (0.5.1) groovy; urgency=medium

  * Fix ZSys package post-installation failed when boot pool is not imported
    (LP: #1886214)
  * Change ZSys GC to only keep one month (LP: #1889385)

 -- Didier Roche <email address hidden> Wed, 29 Jul 2020 11:32:33 +0200

Changed in zsys (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Michał Sawicz (saviq) wrote :

FWIW whenever this happened to me, `/boot` was not empty, so ZFS refused to mount it. Not sure if there's a way, or if it's advisable, to force it to mount over non-empty…

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Patrick, or anyone else affected,

Accepted zsys into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zsys/0.4.7 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 zsys (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Focal:
I have reproduced the problem with zsys 0.4.6 in focal-updates and have verified that the version of zsys 0.4.7 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Patrick Gray (patgray1127) wrote :

Should I run any commands before trying to upgrade?
Or should the 0.4.7 upgrade handle my root partition still being in a weird state?

Revision history for this message
mog (launchpad-net-mog) wrote :

Upgrading to zsys from 0.4.6 to focal-proposed 0.4.7 has resolved below issue for me. Thanks for everyone's work.

Requesting to save current system state
Successfully saved as "autozsys_ufuwup"
Setting up zsys (0.4.6) ...
dpkg: error processing package zsys (--configure):
 installed zsys package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 zsys
ZSys is adding automatic system snapshot to GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Patrick Gray (patgray1127) wrote :

seeing this:

root@tmp:/home/pgray# apt install zsys/focal-proposed
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '0.4.7' (Ubuntu:20.04/focal-proposed [amd64]) for 'zsys'
The following package was automatically installed and is no longer required:
  libfprint-2-tod1
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
  zsys
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,634 kB of archives.
After this operation, 0 B of additional disk space will be used.
Requesting to save current system state
Successfully saved as "autozsys_63hqvl"
(Reading database ... 212063 files and directories currently installed.)
Preparing to unpack .../archives/zsys_0.4.7_amd64.deb ...
Unpacking zsys (0.4.7) over (0.4.6) ...
Setting up zsys (0.4.7) ...
zsys-gc.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.9.1-1) ...
ZSys is adding automatic system snapshot to GRUB menu
ERROR Service took too long to respond. Disconnecting client.

This is still not the desired outcome, correct?

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

@Patrick: this is a separate issue (probably too many datasets or something else), but the actual bug (apt installation being broken) is fixed.
Feel free to open another bug with ubuntu-bug zsys. Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zsys - 0.4.7

---------------
zsys (0.4.7) focal; urgency=medium

  * Fix ZSys package post-installation failed when boot pool is not imported
    (LP: #1886214)
  * Change ZSys GC to only keep one month (LP: #1889385)

 -- Didier Roche <email address hidden> Wed, 29 Jul 2020 11:32:33 +0200

Changed in zsys (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 zsys 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.