I am trying to start docker containers using a script, however, I have observed that the containers do not start at random, and I get the similar error message every time -
level="fatal" msg="Error response from daemon: Cannot start container 5cdfbcf5bcf140410e8bec0055614f2d93afaa04fd455e9a7960fed546cf0fa3: Error getting container 5cdfbcf5bcf140410e8bec0055614f2d93afaa04fd455e9a7960fed546cf0fa3 from driver devicemapper: Error mounting '/dev/mapper/docker-202:1-275538-5cdfbcf5bcf140410e8bec0055614f2d93afaa04fd455e9a7960fed546cf0fa3' on '/var/lib/docker/devicemapper/mnt/5cdfbcf5bcf140410e8bec0055614f2d93afaa04fd455e9a7960fed546cf0fa3': no such file or directory"
However, if i run the same command again after it fails, it works.
I am launching the containers using Weave.
Can anyone tell me how to prevent this from happening, or a shell script which checks if the error is thrown and automatically run it again?