New issue
Advanced search Search tips

Issue 834611 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Can't delete an exited Docker container in Crostini.

Project Member Reported by evanbrown@google.com, Apr 19 2018

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 10539.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3383.0 Safari/537.36
Platform: 10539.0.0 (Official Build) dev-channel eve

Steps to reproduce the problem:
With Docker version 17.09.1-ce, build 19e2cf6, it is not possible to remove a container after it has exited. To reproduce:

$ docker run -ti --name bug-demo alpine sh
/ # exit

$ docker ps -a | grep bug-demo
bf0a02dac8a6        alpine              "sh"                     10 seconds ago      Exited (0) 7 seconds ago                       bug-demo

$ docker rm bf0a02dac8a6
Error response from daemon: driver "btrfs" failed to remove root filesystem for bf0a02dac8a661f1bcf19432e141dfe887c455fae7ac5fc8e7772393f1273f0d: Failed to destroy btrfs snapshot /var/lib/docker/btrfs/subvolumes for 6c094edd04ca84811e17b35849d24d24279cf2510e7d7991c384c828f2977a76: operation not permitted

What is the expected behavior?
The exited container should be removed.

What went wrong?
According to the error message:

Error response from daemon: driver "btrfs" failed to remove root filesystem for bf0a02dac8a661f1bcf19432e141dfe887c455fae7ac5fc8e7772393f1273f0d: Failed to destroy btrfs snapshot /var/lib/docker/btrfs/subvolumes for 6c094edd04ca84811e17b35849d24d24279cf2510e7d7991c384c828f2977a76: operation not permitted

Did this work before? N/A 

Chrome version: 67.0.3383.0  Channel: dev
OS Version: 10539.0.0
Flash Version: 29.0.0.140
 
Components: OS>Systems>Containers

Comment 2 by jkwang@google.com, Apr 19 2018

Owner: jkwang@google.com

Comment 4 by jkwang@google.com, Apr 24 2018

Cc: dgreid@chromium.org
The moby issue happens when "docker in docker", we are using "docker in lxd" so I bet it's similar.
According to the comments in the moby issue, we need this:
https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-July/009881.html

+ dylan@
Anyone familiar with btrfs?
Is the btrfs filesystem that LXD uses mounted with

user_subvol_rm_allowed

? That would explain the error that you're seeing.
re #4 - I'm familiar with btrfs - sadly.
So this:  

  mkfs.btrfs /dev/vdb || true # The disk may already be formatted.
  mount /dev/vdb /mnt/stateful || die "Failed to mount stateful disk"

should be

  mkfs.btrfs /dev/vdb || true # The disk may already be formatted.
  mount -o user_subvol_rm_allowed /dev/vdb /mnt/stateful || die "Failed to mount stateful disk"

in https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/project-termina/chromeos-base/termina-lxd-scripts/files/stateful_setup.sh#31

Comment 8 by jkwang@google.com, Apr 24 2018

That's fast. Thank you very much. 
np
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/4b362746ad3635468c86b3603e8ff2228c3dc355

commit 4b362746ad3635468c86b3603e8ff2228c3dc355
Author: Jingkui Wang <jkwang@google.com>
Date: Thu Apr 26 03:16:55 2018

tatl: fix btrfs mount

mount btrfs with user_subvol_rm_allowed.

BUG= chromium:834611 
TEST=build tatl image and run docker/docker rm

Change-Id: Id7c86b6584cd2741dc5dd93e1fb3807b6076efc4
Reviewed-on: https://chromium-review.googlesource.com/1028989
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[rename] https://crrev.com/4b362746ad3635468c86b3603e8ff2228c3dc355/project-termina/chromeos-base/termina-lxd-scripts/termina-lxd-scripts-0.0.1-r17.ebuild
[modify] https://crrev.com/4b362746ad3635468c86b3603e8ff2228c3dc355/project-termina/chromeos-base/termina-lxd-scripts/files/stateful_setup.sh

I updated to Chrome/67.0.3396.26 (dev) and this issue is resolved. Lovely! Thanks, everyone.

Comment 12 by jkwang@google.com, May 1 2018

Status: Verified (was: Unconfirmed)

Sign in to add a comment