testcontainers-java: Could not connect to Ryuk - Linux, Docker 20.10.0, 1.15.0-rc2
As this is my first issue i would like to say “Thank you” to all maintainers and contributors.
Apparently, out of nothing my tests started to throw:
Caused by: java.lang.IllegalStateException: Could not connect to Ryuk at localhost:49160
at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:171)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:201)
at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
at org.testcontainers.LazyDockerClient.listImagesCmd(LazyDockerClient.java:12)
at org.testcontainers.images.LocalImagesCache.maybeInitCache(LocalImagesCache.java:68)
at org.testcontainers.images.LocalImagesCache.get(LocalImagesCache.java:32)
at org.testcontainers.images.AbstractImagePullPolicy.shouldPull(AbstractImagePullPolicy.java:18)
at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:65)
at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:26)
at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:17)
at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:39)
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1280)
... 266 more
I am on Linux with: openjdk 11.0.8 2020-07-14 testcontainers 1.15.0-rc2 docker 20.10.0
The container seems to start:
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85335add1def testcontainers/ryuk:0.3.0 "/app" 1 second ago Up Less than a second 0.0.0.0:49160->8080/tcp testcontainers-ryuk-2b08ab75-8559-48fc-8f73-8d233b45c430
and the logs do not seem too wrong:
$ docker logs 85335add1def
2020/12/09 09:47:37 Pinging Docker...
2020/12/09 09:47:37 Docker daemon is available!
2020/12/09 09:47:37 Starting on port 8080...
2020/12/09 09:47:37 Started!
Still, the above exception happens after the default timeout of 30 seconds.
Let me know if you need more information, stack traces or logs.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 33 (12 by maintainers)
I found out that my issue must be related to the VPN i am connected to. When i turn if off everything works fine. When i am connected i get those connection problems. Will try to figure out whats going on with my networking.
Thanks so far.
Same issue here (1.15.1 and TCP connectivity), resolved by stopping VPN (Cisco AnyConnect) then restarting Docker for Windows then (re)starting VPN. Could not reproduce the issue after that though. Did not try ‘Allow local LAN access’, will do next time.
FYI 1.15.1 is released and fixes “No such image” issue (#3574). Please only comment if you still see the issue with 1.15.1 and it is related to the TCP connectivity, not the image pulling. Thanks.
Experiencing the same out of the blue when executing in EC2, this was still working this morning. The stack trace has this:
But looking at the Docker Hub that image does exists there.
Encountered the same issue (1.15.2, ubuntu 20.04 LTS with ufw enabled). It turns out that the Ryuk container is started on the default bridge network, while my other containers are started in my custom bridge network. Then the ufw firewall doesn’t allow communication between these private networks, which I could resolve by adding rules. A nicer solution for me would be if I could specify in which network the Ryuk container is started, but I can’t find that anywhere, such that it also starts in my custom bridge network.
Then it’s the same stacktrace a bunch of more times, like 10 times, and at the end:
Test fails with application context failed to load.
I’m trying to reproduce this TCP/connection to Ryuk issue, but haven’t managed to so far 😬
Using a fresh VM with Ubuntu 20.04 (LTS) x64 and Docker version 20.10.0, build 7287ab3
I’m testing with 1.15-0rc2, 1.15.0 and master/HEAD and so far not able to reproduce. Will continue to try.
Filed an issue for “No such image: testcontainers/ryuk:0.3.0” (Status 404) at #3574. Sorry for the spam.
It doesn’t, yes.
Why?
404is “not found” and 4xx type of an http code, non-retriable. I don’t think registries should return 404 for images that exist.Although the original issue report is talking about some other, TCP related issue, so please consider reporting 404 separately, this is some other issue.
Also got
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such image: testcontainers/ryuk:0.3.0"Looks like related to docker version: Working version:
Non working version:
My mistake, was too hasty to draw conclusions between the two issues.