Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hantsy opened this issue Nov 2, 2020 · 12 comments
Closed

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

hantsy opened this issue Nov 2, 2020 · 12 comments

Comments

@hantsy
Copy link

hantsy commented Nov 2, 2020

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.

@bsideup bsideup changed the title Can not connect to ryuk "Can not connect to Ryuk" on Win with Docker Desktop Edge 2.4.2.0 Nov 2, 2020
@kiview
Copy link
Member

kiview commented Nov 2, 2020

I just tried out Docker Desktop Edge 2.4.2.0 on Windows 10 1904 with WSL2 backend and can't reproduce the error.
Which engine backend are you using?

And this error happened after the update to Edge?

@hantsy
Copy link
Author

hantsy commented Nov 3, 2020

Image 1

I was using Windows 10 Pro 64bit insider build 20246, not sure if it is the system problem

@hantsy
Copy link
Author

hantsy commented Nov 3, 2020

Reinstall Docker, and purge all data, it is disappeared

@hantsy hantsy closed this as completed Nov 3, 2020
@energister
Copy link

In my case setup was hanging during Docker uninstallation so computer reboot was required.

@wallysoncarvalho
Copy link

I'm having a similar problem. Does anyone have any idea? It just keeps trying to connect until it aborts.

Windows 10
Docker Desktop 3.0.0
Test Container Version 1.15.1

21:29:20.394 [main] DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/5409773a80d2342cbdc6a5c1b9533749bd23c7dc837d8378575e49c4bee70222/json], queryParams={}}
21:29:22.593 [testcontainers-ryuk] WARN org.testcontainers.utility.ResourceReaper - Can not connect to Ryuk at localhost:55005
java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.connect0(Native Method)
....

Ryuk's container logs:

2020/12/20 00:31:50 Pinging Docker...
2020/12/20 00:31:50 Docker daemon is available!
2020/12/20 00:31:50 Starting on port 8080...
2020/12/20 00:31:50 Started!

@ibecar
Copy link

ibecar commented Dec 26, 2020

I have exactly the same problem and configuration as @wallysoncarvalho, did you find a solution ?

@buildingsoftwareblocks
Copy link

Same problem here...

@ibecar
Copy link

ibecar commented Jan 11, 2021

Same problem here...

Just so you know, I couldn't come up with any solution other than downgrade

@bjmi
Copy link

bjmi commented Jan 20, 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 #3609 (comment)
Caution: netcfg -d Performs a cleanup on all networking devices. This will require a reboot.
Edit2:
docker/for-win#3171 addresses this in Docker for Windows.
powershell restart-service winnat helps temporarily as netcfg -d didn't solve it permanently.

@naXa777
Copy link

naXa777 commented Mar 3, 2021

SOLUTION: after running netcfg -d from docker/for-win#3171 (comment) and rebooting computer, testcontainers works again. Windows woodoo detected 👻

@energister
Copy link

Tip: check whether you are able to run Ryuk manually

docker run -i --mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock testcontainers/ryuk:0.3.1

@kiview
Copy link
Member

kiview commented Jul 12, 2021

If I look at the port number for which this fails, this seems to be related to #4263 and the corresponding issues #3609 and the upstream issue at docker/for-win#11584.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants