Docker for Mac - cannot connect to Ryuk
See original GitHub issueI 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 prunemakes 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
"Can not connect to Ryuk" on macOS with Docker for Mac 2.4 ...
I've seen this exact error come and go a fair bit on here, but it's just today started happening for me. I'm using...
Read more >Could not connect to Ryuk at localhost:49167 - Stack Overflow
Same Docker-for-Mac version. Solution for me was to disable "Use gRPC FUSE for file sharing" in Preferences: Preferences.
Read more >Testcontainers stoped working | Bitbucket Cloud - Jira
As of this morning testcontainers fail with: [containers-ryuk] o.testcontainers.utility.ResourceReaper : Can not connect to Ryuk at localhost:32768
Read more >Custom configuration - Testcontainers for Java
Testcontainers will attempt to detect the Docker environment and configure everything to work automatically. ... Path to Docker's socket. Used by Ryuk, Docker...
Read more >testcontainers/ryuk - Docker Image
Usage · Start it: $ ./bin/moby-ryuk -p 8080 $ # You can also run it with Docker $ docker run -v /var/run/docker. ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ok, upgrading testcontainers to 1.15.0-rc2 solved the issue, 1.14.3 still showed it.
I’m seeing this issue again on Docker Desktop for Mac v2.4.0.0 and Catalina 10.15.7 - anybody else or is it just me?