"Can not connect to Ryuk" on Win with Docker Desktop Edge 2.4.2.0

See original GitHub issue

Upgrade to the latest Docker Desktop Edge(2.4.2.0), and using Testcontainers 1.5.0-rc2.

❯ docker -v
Docker version 20.10.0-beta1, build ac365d7

When running my testing codes, failed with the following errors:

12:15:08.008 [testcontainers-ryuk] WARN org.testcontainers.utility.ResourceReaper - Can not connect to Ryuk at localhost:49153
java.net.ConnectException: Connection refused: connect
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:574)
	at java.base/sun.nio.ch.Net.connect(Net.java:563)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333)
	at java.base/java.net.Socket.connect(Socket.java:648)
	at java.base/java.net.Socket.connect(Socket.java:597)
	at java.base/java.net.Socket.<init>(Socket.java:520)
	at java.base/java.net.Socket.<init>(Socket.java:294)
	at org.testcontainers.utility.ResourceReaper.lambda$null$1(ResourceReaper.java:133)
	at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27)
	at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:131)
	at java.base/java.lang.Thread.run(Thread.java:832)
12:15:10.292 [testcontainers-ryuk] WARN org.testcontainers.utility.ResourceReaper - Can not connect to Ryuk at localhost:49153

When inspect the docker errors, I got the following info:

2020/11/02 04:05:47 Pinging Docker...

panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


goroutine 1 [running]:

main.main()

/go/src/github.com/testcontainers/moby-ryuk/main.go:35 +0xcf5

I am sure docker is running, and I can run other docker commands in Powershell/cmd.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
bjmicommented, Feb 9, 2021

Unfortunately I encounter this problem too.

Windows 10 Docker Desktop 3.1.0 Test Container Version 1.15.1

17:20:36 I [      main]   o.t.DockerClientFactory : Connected to docker: 
  Server Version: 20.10.2
  API Version: 1.41
  Operating System: Docker Desktop
  Total Memory: 25520 MB
17:20:36 I [      main] .t.u.ImageNameSubstitutor : Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
17:20:39 W [iners-ryuk]      o.t.u.ResourceReaper : Can not connect to Ryuk at localhost:49154
java.net.ConnectException: Connection refused: connect

Ryuk’s container logs:

2021/01/20 16:20:37 Pinging Docker...
2021/01/20 16:20:37 Docker daemon is available!
2021/01/20 16:20:37 Starting on port 8080...
2021/01/20 16:20:37 Started!

Are there any solutions / workarounds so far?

Edit: I could solve it running netcfg -d described in https://github.com/testcontainers/testcontainers-java/issues/3609#issuecomment-756098790 Caution: netcfg -d Performs a cleanup on all networking devices. This will require a reboot. Edit2: https://github.com/docker/for-win/issues/3171 addresses this in Docker for Windows. powershell restart-service winnat helps temporarily as netcfg -d didn’t solve it permanently.

8reactions
naXa777commented, Mar 3, 2021

SOLUTION: after running netcfg -d from https://github.com/docker/for-win/issues/3171#issuecomment-731096674 and rebooting computer, testcontainers works again. Windows woodoo detected 👻

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to Ryuk at localhost:49167 - Stack Overflow
I can confirm that this is resolved by updating testcontainers to 1.16.0 version. Was facing the same exception with testcontainers 1.15.3.
Read more >
Docker Desktop for Mac Edge release notes
This page contains information about Docker Desktop Edge releases. Edge releases give you early access to our newest features. Note that some of...
Read more >
2021年08月_weixin_39537049的博客_CSDN博客
organization cannot found. 2021-01-12 ... "Can not connect to Ryuk" on Win with Docker Desktop Edge 2.4.2.0. 2021-01-11.
Read more >
Arnaud Héritier on Twitter: "A lot of people gave me a good ...
but my 1st try is a fail :( > Can not connect to Ryuk at localhost:32778 I ... It seems to be both...
Read more >
Could not connect to Ryuk at localhost:49154 on Docker for ...
I am using Docker Desktop on Windows 10. Version 3.0.0 (50684) Engine: 20.10.0
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found