docker.io post-removal script fails to delete btrfs subvolume, when /var/lib/docker is on an ext4 filesystem

Bug #1814149 reported by Kellen Renshaw
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

krenshaw@computer:~$ sudo apt purge docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cgroupfs-mount pigz ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  docker.io*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 192492 files and directories currently installed.)
Removing docker.io (18.06.1-0ubuntu1~16.04.2) ...
Purging configuration files for docker.io (18.06.1-0ubuntu1~16.04.2) ...

Nuking /var/lib/docker ...
  (if this is wrong, press Ctrl+C NOW!)

+ sleep 10

+ btrfs subvolume delete /var/lib/docker/aufs/diff/d160fb421ed8b68160680f8ee2ba97dfc7999f1b003afde43d7fb9a6517db2ea/usr/share/locale/cy
ERROR: not a subvolume: /var/lib/docker/aufs/diff/d160fb421ed8b68160680f8ee2ba97dfc7999f1b003afde43d7fb9a6517db2ea/usr/share/locale/cy
dpkg: error processing package docker.io (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)

/ (and therefore /var/lib/docker) is:
/dev/mapper/ubuntu--vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: docker.io (not installed)
ProcVersionSignature: Ubuntu 4.15.0-43.46~16.04.1-generic 4.15.18
Uname: Linux 4.15.0-43-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.1-0ubuntu2.18
AptOrdering:
 docker.io: Purge
 NULL: ConfigurePending
Architecture: amd64
Date: Thu Jan 31 10:33:08 2019
ErrorMessage: subprocess installed post-removal script returned error exit status 1
InstallationDate: Installed on 2017-02-27 (703 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.5
 apt 1.2.29ubuntu0.1
SourcePackage: docker.io
Title: package docker.io (not installed) failed to install/upgrade: subprocess installed post-removal script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kellen Renshaw (krenshaw) wrote :
summary: docker.io post-removal script fails to delete btrfs subvolume, when
- /var/lib/docker is on an ext4 filessytem
+ /var/lib/docker is on an ext4 filesystem
tags: removed: need-duplicate-check
Revision history for this message
Brett Milford (brettmilford) wrote :

The post rm script calls `nuke-graph-directory.sh` which relies on these predicates to identify btrfs subvolumes:

if command -v btrfs > /dev/null 2>&1; then
        # Find btrfs subvolumes under $dir checking for inode 256
        # Source: http://stackoverflow.com/a/32865333
        for subvol in $(find "$dir" -type d -inum 256 | sort -r)

Which on my system (not using btrfs) returns many directories.

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
Brett Milford (brettmilford) wrote :
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.