Repository navigation
Labels
area/storage/devicemapperkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Description
When running something like for i in {0..100}; do docker run busybox echo test; done with Docker running on devicemapper, errors are thrown and containers fail to run:
2014/02/10 9:48:42 Error: start: Cannot start container 56bee8c4da5bd5641fc42405c742083b418ca14ddfb4a3e632955e236e23c284: Error getting container 56bee8c4da5bd5641fc42405c742083b418ca14ddfb4a3e632955e236e23c284 from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-4980769-56bee8c4da5bd5641fc42405c742083b418ca14ddfb4a3e632955e236e23c284' on '/var/lib/docker/devicemapper/mnt/56bee8c4da5bd5641fc42405c742083b418ca14ddfb4a3e632955e236e23c284': no such file or directory
2014/02/10 9:48:42 Error: start: Cannot start container b90b4385778142aab5251846460008e5c4eb9fe1e7ec82f07d06f1de823bd914: Error getting container b90b4385778142aab5251846460008e5c4eb9fe1e7ec82f07d06f1de823bd914 from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-4980769-b90b4385778142aab5251846460008e5c4eb9fe1e7ec82f07d06f1de823bd914' on '/var/lib/docker/devicemapper/mnt/b90b4385778142aab5251846460008e5c4eb9fe1e7ec82f07d06f1de823bd914': no such file or directory
2014/02/10 9:48:43 Error: start: Cannot start container ca53b3b21c92ffb17ad15c1088be293260ea240abdf25db7e5aadc11517cf93c: Error getting container ca53b3b21c92ffb17ad15c1088be293260ea240abdf25db7e5aadc11517cf93c from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-4980769-ca53b3b21c92ffb17ad15c1088be293260ea240abdf25db7e5aadc11517cf93c' on '/var/lib/docker/devicemapper/mnt/ca53b3b21c92ffb17ad15c1088be293260ea240abdf25db7e5aadc11517cf93c': no such file or directory
test
2014/02/10 9:48:43 Error: start: Cannot start container 1e1e06044711e73cede8ede10547de7e270c33fac7ad5e60a8cb23246950adf3: Error getting container 1e1e06044711e73cede8ede10547de7e270c33fac7ad5e60a8cb23246950adf3 from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-4980769-1e1e06044711e73cede8ede10547de7e270c33fac7ad5e60a8cb23246950adf3' on '/var/lib/docker/devicemapper/mnt/1e1e06044711e73cede8ede10547de7e270c33fac7ad5e60a8cb23246950adf3': no such file or directory
Fedora 20 with kernel 3.12.9 doesn't seem to be affected.
kernel version, distribution, docker info and docker version:
3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64
Ubuntu 12.04.4
docker info
Containers: 101
Images: 44
Driver: devicemapper
Pool Name: docker-8:1-4980769-pool
Data file: /var/lib/docker/devicemapper/devicemapper/data
Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 3234.9 Mb
Data Space Total: 102400.0 Mb
Metadata Space Used: 6.9 Mb
Metadata Space Total: 2048.0 Mb
Client version: 0.8.0-dev
Go version (client): go1.2
Git commit (client): 695719b
Server version: 0.8.0-dev
Git commit (server): 695719b
Go version (server): go1.2
Last stable version: 0.8.0
The Docker binary is actually master with PR #4017 merged.
/cc @alexlarsson
Metadata
Metadata
Assignees
Labels
area/storage/devicemapperkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Activity
discordianfish commentedon Feb 11, 2014
Same here, running ubuntu precise with lts-raring kernel (3.8.0-35-generic).
alexlarsson commentedon Feb 11, 2014
This is due to a race with udev. The problem is that starting a container creates a dm device, activates it and then immediately deactivates it and then activates it again. This races with the udev device-node creation such that you end up in a state where the device node created by udev is removed by docker.
Avoid extra mount/unmount during container registration
unclejack commentedon Feb 11, 2014
@alexlarsson Could we work around it somehow? It looks like every non-Fedora system has this problem.
alexlarsson commentedon Feb 11, 2014
@unclejack #4067 fixes it
discordianfish commentedon Feb 12, 2014
The problem seems to be fixed for runs, but not for builds. When building this Dockerfile:
docker fails with the same error:
alexlarsson commentedon Feb 12, 2014
@discordianfish I'll have a look at that.
Avoid extra mount/unmount during build
alexlarsson commentedon Feb 12, 2014
#4096 fixes a similar spurious mount/unmount cycle during build.
alexlarsson commentedon Feb 12, 2014
While the above fixes will fix this for most people we should probably leave this open to track the actual problem of the udev race, as it would be good to have a fix for that too.
discordianfish commentedon Feb 12, 2014
The above fixes are a big improvement, but when restarting container it sometimes still happens:
Avoid extra mount/unmount during build
405 remaining items
zync-mzy commentedon May 17, 2016
I ran
for i in {0..100}; do docker run busybox echo test; doneusing docker 1.11 and got no error.Can I say that devicemapper is race-free using docker 1.11?
If I can, what differences does udev_sync_supported make?
docker info (sorry that I can't publish kernel and os)
davehodg commentedon May 19, 2016
This is still a problem? I have:
docker --version
Docker version 1.11.1, build 5604cbe
Getting:
docker build -t mongodb .
Sending build context to Docker daemon 16.9 kB
Step 1 : FROM registry.access.redhat.com/rhel7.2
---> bf2034427837
Step 2 : MAINTAINER Joe Bloggs
devmapper: Unknown device b4904eb2bd71c7aa6cc50c8ac7c9695845641de531ed6d8b97742857258b418e
docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:42 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:42 2016
OS/Arch: linux/amd64
So pretty fresh I think.
thaJeztah commentedon May 19, 2016
@davehodg can you show your
docker info?davehodg commentedon May 19, 2016
docker info
Containers: 32
Running: 0
Paused: 0
Stopped: 32
Images: 1
Server Version: 1.11.1
Storage Driver: devicemapper
Pool Name: docker-253:0-20487-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 11.93 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use
--storage-opt dm.thinpooldevor use--storage-opt dm.no_warn_on_loop_devices=trueto suppress this warning.Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2015-12-01)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host bridge null
Kernel Version: 3.10.0-327.13.1.el7.x86_64
Operating System: Red Hat Enterprise Linux
OSType: linux
Architecture: x86_64
CPUs: 3
Total Memory: 5.518 GiB
Name: daves-macbook-air
ID: MIBZ:OB6L:J4Q2:OD6P:EVEZ:XEHS:JT3V:SLZG:ALFZ:NC47:IYXQ:72EE
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
davehodg commentedon May 19, 2016
If I were to get the freshest most up to date docker, where would I get it from?
davehodg commentedon May 19, 2016
OK, got the source from here. Tried make:
make
docker build -t "docker-dev:master" -f "Dockerfile" .
Sending build context to Docker daemon 130.2 MB
Step 1 : FROM debian:jessie
jessie: Pulling from library/debian
8b87079b7a06: Already exists
a3ed95caeb02: Already exists
Digest: sha256:32a225e412babcd54c0ea777846183c61003d125278882873fb2bc97f9057c51
Status: Downloaded newer image for debian:jessie
---> bb5d89f9b6cb
Step 2 : RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61 || apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
devmapper: Unknown device 50a33b69e5edbf78d012da68ac249b1af5a9fddaeb316c662e6a65f763c974e2
make: *** [build] Error 1
I think I might make a new RHEL7 vmware image...
thaJeztah commentedon May 19, 2016
@davehodg also see #22031
davehodg commentedon May 19, 2016
Not really telling me anything new :(
thaJeztah commentedon May 19, 2016
@davehodg no, problem is indeed that it's quite an unpredictable issue. It's known to be problematic on systems without udev-sync, also running on "loop devices" doesn't help.
davehodg commentedon May 19, 2016
Thanks. I'm so far down the rabbit hole at this point.
davehodg commentedon May 20, 2016
Register my whine, but I've moved to running Docker on my Mac. Let's see how that transpires.
jizhilong commentedon Jul 14, 2016
I also encountered this issue in our environment, and I worked out a way to reproduce it, hope it may help to resolve the issue.
docker info
way to reproduce
make sure all containers removed
get image ready
a
busyboximage would be sufficient,docker pull busyboxget script ready
A Python script is needed to eagerly detect and open any docker created non-init dm devices:
make sure all container or image related dm devices removed
run
dmsetup infoto list all dm devices on your node, and rundmsetup remove <name>to remove all devices whose name starts withdocker-and ends with a uuid or<uuid>-init, such asdocker-252:1-58724678-3c96b9d15c41b49816eab1faaa0cb6eaa7cdffe5decd45f2bd48ae72f32e16f5run the script and reproduce the issue
following is one sample of my reproducing logs:
the essential commands are:
get the corrupted container back to normal
the essential operations to recover the container include:
python opendm.pythaJeztah commentedon Jul 14, 2016
@jizhilong can you please open a new issue? The original issue reported here was resolved and related to
udev-syncnot being available, causing corruption. Since your machine looks to have udev-sync support, it's likely a different issue. This discussion is already very long, so it's better to open a new issue, than commenting on a closed issue.thaJeztah commentedon Jul 14, 2016
I'm locking this issue, and provide a link and quote to the resolution for the issue that was originally reported: #4036 (comment). If you still encounter this, please open a new issue with as much information as possible and steps to reproduce.
(I modified some outdated information in the description below)
This issue is resolved
Key item to observe before commenting on this issue, is whether
docker info | grep Udevreturns forUdev Sync Supported: trueor not.Udev sync
Devicemapper storage driver expects to be synchronized with udev. When this info reports
false, that means that devicemapper and udev are not able to sync. In this event there is a race condition that many of you have experienced.Causes
There are a couple of causes for Udev sync to not be supported:
libdevmapper.sotoo old to support Udev syncSolutions
git clone git://github.com/docker/docker.gitcd dockerAUTO_GOPATH=1 ./hack/make.sh dynbinaryfile $(which docker) | grep dynamically) and Udev sync reports false, you will likely need to update the distribution release usedDocker 1.11 and up will refuse to start the daemon if Udev sync is not supported (see #21097)