mv: cannot stat '/var/lib/docker.migrating/*': No such file or directory

Bug #1882942 reported by Andreas Hasenack
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Got this postinst failure when release-upgrading a focal laptop to groovy. /var/lib/docker was already on its own datase as per upstream's recommendation. I called it rpool/docker.

Preparing to unpack .../110-docker.io_19.03.11-0ubuntu1_amd64.deb ...
Unpacking docker.io (19.03.11-0ubuntu1) over (19.03.8-0ubuntu1) ...
(...)
Setting up docker.io (19.03.11-0ubuntu1) ...
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

Attempts to run apt -f install just repeat the error:
Setting up docker.io (19.03.11-0ubuntu1) ...
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

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Adding set -x to the postinst section, we see this:
Setting up docker.io (19.03.11-0ubuntu1) ...
+ modinfo zfs
+ zfs mount
+ + awkcut -d/ -f1
 $2=="/" {print $1}
+ rpool=rpool
+ [ -n rpool ]
+ findmnt -n -o SOURCE /var/lib/docker
+ dockermnt=rpool/docker
+ echo rpool/docker
+ grep -qE ^$|/ROOT/
+ dpkg --compare-versions 19.03.8-0ubuntu1 le-nl 19.03.8-0ubuntu2
+ mv /var/lib/docker.migrating/* /var/lib/docker/
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

Changed in docker.io (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 19.03.11-0ubuntu2

---------------
docker.io (19.03.11-0ubuntu2) groovy; urgency=medium

  [ Jean-Baptiste Lallement ]
  [ Didier Roche ]
  * Fix postinst docker migration if people migrated to new layout manually
    before installing migrated version. (LP: #1882942)
  * Ensure new install creates <pool>/var/lib/docker if any of their history is
    a ZFS installation.

 -- Didier Roche <email address hidden> Wed, 10 Jun 2020 15:25:30 +0200

Changed in docker.io (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Some Guy On The Net (lockszmith) wrote :

Copying over my workaround from https://github.com/ubuntu/zsys/issues/170#issuecomment-826359558 :

Just to chime in, I've been having the same issue myself.
Following @ddnexus's [analysis of the issue](https://github.com/ubuntu/zsys/issues/170#issuecomment-715901655_), the workaround is rather simple:
```
sudo mkdir /var/lib/docker.migrating
echo 'dummy' | sudo tee /var/lib/docker.migrating/workaround.txt
```
this will allow the `stat '/var/lib/docker.migrating/*'` to not fail with an error.

After the successful `apt update docker.io` run, you can remove the workaround dummy file:
```
sudo rm /var/lib/docker/workaround.txt
```

Hope others find this useful.

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.