moby: "Driver aufs failed to remove root filesystem" after calling "timedatectl status" on 1.12.0 with aufs
Output of docker version
:
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:40:59 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:40:59 2016
OS/Arch: linux/amd64
Output of docker info
:
Containers: 13
Running: 13
Paused: 0
Stopped: 0
Images: 195
Server Version: 1.12.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 268
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options:
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 29.5 GiB
Name: hello-4-225
ID: KI4A:WOXH:U5XJ:BGKR:HYCI:LCA4:Y35F:E5RD:ICI5:C5FO:V4UX:THIB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
Insecure Registries:
127.0.0.0/8
Additional environment details (AWS, VirtualBox, physical, etc.):
AWS and bare-metal servers
Steps to reproduce the issue: Run this in bash:
docker run -d --name hello ubuntu sleep 1000 ; timedatectl status ; docker stop hello ; docker rm hello
Describe the results you received:
# docker run -d --name hello ubuntu sleep 1000 ; timedatectl status ; docker stop hello ; docker rm hello
196a2f3a2fed3c7e54e38b6b678f252f6f77b3266903c66fef972e34c750bb0b
Local time: Mon 2016-08-15 15:10:51 UTC
Universal time: Mon 2016-08-15 15:10:51 UTC
RTC time: Mon 2016-08-15 15:10:51
Time zone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
hello
Error response from daemon: Driver aufs failed to remove root filesystem 196a2f3a2fed3c7e54e38b6b678f252f6f77b3266903c66fef972e34c750bb0b: rename /var/lib/docker/aufs/mnt/e70acab187bae790b8e920a9420deb6c02ad4f659d51d9f265e9aa7699fec213 /var/lib/docker/aufs/mnt/e70acab187bae790b8e920a9420deb6c02ad4f659d51d9f265e9aa7699fec213-removing: device or resource busy
Describe the results you expected: The container should be successfully deleted.
Additional information you deem important (e.g. issue happens only occasionally): I was not able to reproduce it on 1.9.1.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 47 (29 by maintainers)
@anusha-ragunathan the problem is the we do actually mount directories from the host, and I find it a very popular thing to do đ
Thanks @anusha-ragunathan for your feeback. Here are my investigation results.
Yes,
timedatectl
seems to have an effect:I then tried to add the
MountFlags=private
to the systemd configuration. Aftersystemctl daemon-reload
andsystemctl restart docker
(I am not an expert at systemd and I hope those commands are correct).This changed apparently fixed the problem. I do not understand why but I will investigate this parameter further.
I can reproduce it on 1.12, same bug as with #22260, but this one reproductible đ
Error response from daemon: Driver aufs failed to remove root filesystem 2966cd5b898c822762119b5d8c83f36659e9a891a19e950308dd02c2a729a74e: rename /var/lib/docker/aufs/mnt/41f77aaf79de753f0255d1f4f5894b7df0efa6a3c490337bea5b4641c2e6997d /var/lib/docker/aufs/mnt/41f77aaf79de753f0255d1f4f5894b7df0efa6a3c490337bea5b4641c2e6997d-removing: device or resource busy
sudo fuser -m /var/lib/docker/aufs/mnt/41f77aaf79de753f0255d1f4f5894b7df0efa6a3c490337bea5b4641c2e6997d /var/lib/docker/aufs/mnt/41f77aaf79de753f0255d1f4f5894b7df0efa6a3c490337bea5b4641c2e6997d: 11303 11305 11306 20416m 20631 21446 24748m 25131 25143 25146 26705 26716
pid are from other container and docker daemon
@chhsia0 âdevice or resource busyâ issues are known to be more troublesome in older kernels (youâll find several reports of this, and some workarounds / suggestions to make it less likely); the upcoming 7.4 release of RHEL/CentOS will have a kernel with fixes for this, that may help
Dug up some history:
daemon flags changed to default âsharedâ mount propagation in https://github.com/docker/docker/commit/2aee081cad72352f8b0c37ba0414ebc925b022e8 in an effort to help volume mounts to ensure shared. This change made it to 1.12, which is probably why thereâs more reports since then.
Prior to this, the flags were indeed set to âslaveâ in https://github.com/docker/docker/commit/eb76cb2301fc883941bc4ca2d9ebc3a486ab8e0a to avoid EBUSY errors on container remove. Thereâs a blog post on why this was done. Although it mentions devicemapper, the problem exists across graphdrivers. http://blog.hashbangbash.com/2014/11/docker-devicemapper-fix-for-device-or-resource-busy-ebusy/
@simkim @genezys : Sorry for the multiple questions, but itâs great that you have a consistent repro and hence the line of questioning. What is the MountFlags set on your hosts? You can look at the docker systemd service file. Itâs typically located in
/lib/systemd/system/docker.service
. If thereâs no entry for âMountFlagsâ, then the default is âsharedâ. If it is indeed âsharedâ, then can you change is to âprivateâ and see if the issue reproduces again.But we do have extra debug details in the daemon logs now if you have
fuser
installed⊠which on Debian looks to be provided by thepsmisc
package. Can you take a minute to enable debug logging and then reproduce?