docker.io package: cannot stat /var/lib/docker.migrating/*

Bug #1901648 reported by Eric Johnson
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I was running 20.04 and had the docker.io package installed. ZFS root.
I ran do-release-upgrade to upgrade to 20.10. At the end of the upgrade, it said it errored on package docker.io

Setting up docker.io (19.03.13-0ubuntu3) ...
mv: cannot stat '/var/lib/docker.migrating/*': No such file or directory
dpkg: error processing package docker.io (--configure):
 installed docker.io package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 docker.io

I've tried 'apt-get install docker.io', it recognizes that it's not fully installed, but runs into the same error.

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: ubuntu-release-upgrader-core 1:20.10.12
ProcVersionSignature: Ubuntu 5.8.0-25.26-generic 5.8.14
Uname: Linux 5.8.0-25-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: skip
CrashDB: ubuntu
CurrentDesktop: ubuntu:GNOME
Date: Mon Oct 26 21:59:44 2020
InstallationDate: Installed on 2020-07-16 (103 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubuntu-release-upgrader
Symptom: release-upgrade
UpgradeStatus: Upgraded to groovy on 2020-10-26 (0 days ago)
VarLogDistupgradeXorgFixuplog:
 INFO:root:/usr/bin/do-release-upgrade running
 INFO:root:No xorg.conf, exiting

Revision history for this message
Eric Johnson (etjohns2) wrote :
Revision history for this message
Eric Johnson (etjohns2) wrote :

This should probably be filed under the docker.io package instead of ubuntu-release-upgrader.

affects: ubuntu-release-upgrader (Ubuntu) → docker.io (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in docker.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Krzysztof Raczkowski (raczkow) wrote :

I've found this bug too.
It fails on postinst script. I've checked it and I'm wondering why does it try to create zfs dataset when it already exists?

When I applied this patch, everything works OK:

--- /var/lib/dpkg/info/docker.io.postinst.orig 2020-11-08 23:21:14.561453080 +0100
+++ /var/lib/dpkg/info/docker.io.postinst 2020-11-08 23:21:25.104740749 +0100
@@ -31,7 +31,7 @@
    # /var with canmount off if doesn’t exist
    rpool="$(zfs mount | awk '$2=="/" {print $1}'| cut -d/ -f1)"

- if [ -n "$rpool" ]; then
+ if [ -z "$rpool" ]; then
     dockermnt="$(findmnt -n -o SOURCE /var/lib/docker || true)"

     # Create <currentpool>/var/lib/docker if doesn’t exist

Revision history for this message
Benjamin Schmid (benbuntu) wrote :

I have the same problem with a ZFS-based docker deployment.

The issue in my case seems to be, that /var/lib/dpkg/info/docker.io.postinst assumes/hard-coded, that the docker content should be located under the the /var/lib/docker directory. It then tries to migrate this off into a separate dataset.

Too bad: I already created a dedicated ZFS dataset for Docker on my own. And it's also in a different place: My /etc/docker/daemon.json has the following content

    {
        "data-root" : "/srv/docker"
    }

And this is also already a separate ZFS dataset:

   # findmnt -n -o SOURCE /srv/docker
   z4tank/docker

Looking at the docker.io.postinst file, the problem is that it hard-coded always assume /var/lib/docker and does not respect a potential diverting "data-root" setting:

https://git.launchpad.net/ubuntu/+source/docker.io/tree/debian/docker.io.postinst?h=applied/ubuntu/focal-updates#n38

@raczkow @etjohns2 : Do you both share something from my setting? i.e. a preconfigured ZFS dataset or a non-default data-root configuration?

Revision history for this message
Alberto Pianon (alberto-o) wrote :

I'm affected by this bug, too, and I confirm that @raczkow patch solves the problem

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.