I believe that this is most likely a problem with Docker for Mac's userland proxy but am creating a ticket here for initial notes and visibility.
In the last couple of days I've noticed the following test failure on a Mac:
java.lang.IllegalStateException: Can not connect to Ryuk
at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:149)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:125)
at org.testcontainers.containers.GenericContainer.<init>(GenericContainer.java:138)
Various observations:
- These exceptions persist - rerunning the build results in the same failure.
- No test can pass, as Testcontainers can't start up.
- Once the system has entered this broken state, the only way to fix is to restart Docker for Mac. Deleting containers and running
docker system prune makes no difference.
- Ryuk is definitely running, and eventually shuts itself down (after 1 minute, after the Java tests have failed)
- Netcat from the Mac host to Ryuk seems to yield a hung socket - no responses come back, and there's no evidence that Ryuk is receiving any packets. Furthermore, the netcat connection stays 'open' even after the Ryuk container has shut down and been deleted.
On this machine I have Docker Desktop for Mac, Version 2.0.0.3 (31259) - stable version.
This happens after I have run a sufficient number of testcontainers builds (not that many; maybe 5-20?). I can't narrow down a repro case further yet.
I tried to trigger this problem with the following bash snippet, but it did not reoccur:
while true; do
ID=$(docker run -p 8080:8080/tcp -v /var/run/docker.sock:/var/run/docker.sock -d quay.io/testcontainers/ryuk:0.2.3)
echo "foo=bar" | nc localhost 8080
docker kill $ID
done
I believe that this is most likely a problem with Docker for Mac's userland proxy but am creating a ticket here for initial notes and visibility.
In the last couple of days I've noticed the following test failure on a Mac:
Various observations:
docker system prunemakes no difference.On this machine I have Docker Desktop for Mac, Version 2.0.0.3 (31259) - stable version.
This happens after I have run a sufficient number of testcontainers builds (not that many; maybe 5-20?). I can't narrow down a repro case further yet.
I tried to trigger this problem with the following bash snippet, but it did not reoccur: