flapjack / omnibus-flapjack

Flapjack packages for all! Build the packages, and update the repositories.
http://flapjack.io
23 stars 14 forks source link

docker run randomly gets "cannot start container" #75

Closed jessereynolds closed 9 years ago

jessereynolds commented 9 years ago

16:45 Failed build of Flapjack v1.3.0rc1 for debian wheezy package (experimental) in 17m 41s, log: http://is.gd/LvoRYS

It built the package just fine but was unable to start the docker container to execute the tests.

time="2015-02-13T06:14:49Z" level="fatal" msg="Error response from daemon: Cannot start container ceb5e86f16b381d91572690b235803345afb3440c4a222debe215057623bcedc: Error getting container ceb5e86f16b381d91572690b235803345afb3440c4a222debe215057623bcedc from driver devicemapper: Error mounting '/dev/mapper/docker-202:1-32071-ceb5e86f16b381d91572690b235803345afb3440c4a222debe215057623bcedc' on '/var/lib/docker/devicemapper/mnt/ceb5e86f16b381d91572690b235803345afb3440c4a222debe215057623bcedc': no such file or directory" 
jessereynolds commented 9 years ago

Probably because of https://github.com/docker/docker/issues/4036

jessereynolds commented 9 years ago

@Hobbsee couched the docker run calls in a loop and a detection of "Cannot start container" in the docker output. I meddled with that a bit too. But now it seems that Mixlib::ShellOut.new() runs the command but is then unable to tell if it succeeded or not (cmd.exitstatus appears to return nil, and cmd.error? returns true, even after a successful docker run of the build rake task.

Sarah-E-Greene commented 9 years ago

Couple of issues with this one:

while docker_attempts > 0 || success

The refactor changed this to checking only docker_attempts, and docker_success wasn't used to break out of the loop any more. Thus, infinite successful builds.