question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not connect to Ryuk at localhost:49160 since fedora 34

See original GitHub issue

Since upgrading to Fedora 34, testcontainers cant connect to ryuk anymore

2021-07-27 09:04:28.620  INFO 24831 --- [nPool-worker-19] o.t.d.DockerClientProviderStrategy       : Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2021-07-27 09:04:29.107  INFO 24831 --- [nPool-worker-19] o.t.d.DockerClientProviderStrategy       : Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2021-07-27 09:04:29.109  INFO 24831 --- [nPool-worker-19] org.testcontainers.DockerClientFactory   : Docker host IP address is localhost
2021-07-27 09:04:29.133  INFO 24831 --- [nPool-worker-19] org.testcontainers.DockerClientFactory   : Connected to docker: 
  Server Version: 20.10.7
  API Version: 1.41
  Operating System: Fedora 34 (Workstation Edition)
  Total Memory: 31746 MB
2021-07-27 09:04:29.136  INFO 24831 --- [nPool-worker-19] o.t.utility.ImageNameSubstitutor         : Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2021-07-27 09:04:34.656  WARN 24831 --- [containers-ryuk] o.testcontainers.utility.ResourceReaper  : Can not connect to Ryuk at localhost:49161

java.net.SocketTimeoutException: connect timed out
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at org.testcontainers.utility.ResourceReaper.lambda$null$1(ResourceReaper.java:189)
	at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27)
	at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:185)
	at java.base/java.lang.Thread.run(Thread.java:829)

2021-07-27 09:04:39.912  WARN 24831 --- [containers-ryuk] o.testcontainers.utility.ResourceReaper  : Can not connect to Ryuk at localhost:49161

java.net.SocketTimeoutException: connect timed out
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at org.testcontainers.utility.ResourceReaper.lambda$null$1(ResourceReaper.java:189)
	at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27)
	at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:185)
	at java.base/java.lang.Thread.run(Thread.java:829)

Normally i dont use a testcontainers.properties file but i also tried to start the tests with

ryuk.container.privileged = true
ryuk.container.timeout = 120

Same result though. Does anyone know if something specific is changed in f34, which i need to change for testcontainers?

My docker version

Client: Docker Engine - Community
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:57:20 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:55:04 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.8
  GitCommit:        7eba5930496d9bbe375fdf71603e610ad737d2b2
 runc:
  Version:          1.0.0
  GitCommit:        v1.0.0-0-g84113ee
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Thx in advance

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
kucharzykcommented, Jul 27, 2021

I’ve tried fresh Fedora 34 installation (fully updated).

How I’ve installed docker:

sudo dnf install moby-engine 
sudo systemctl start docker
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker $USER

And after restart:

2021/07/27 22:03:16 Pinging Docker...
2021/07/27 22:03:16 Docker daemon is available!
2021/07/27 22:03:16 Starting on port 8080...
2021/07/27 22:03:16 Started!
nc -zv localhost 8080
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to ::1:8080.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.

Testcontainers works like a charm

2021-07-28 00:01:11,518 INFO  [🐳 .2]] (build-34) Creating container for image: postgres:13.2
2021-07-28 00:01:11,553 INFO  [🐳 .2]] (build-34) Starting container with ID: cadeacf19dcf35a520541dfc96bcc7c4381fea50f2cf86ac6922d2c2cc51296e
2021-07-28 00:01:11,843 INFO  [🐳 .2]] (build-34) Container postgres:13.2 is starting: cadeacf19dcf35a520541dfc96bcc7c4381fea50f2cf86ac6922d2c2cc51296e
2021-07-28 00:01:13,616 INFO  [🐳 .2]] (build-34) Container postgres:13.2 started in PT26.885426S

It could be issue related to updating from Fedora 33 (or messed configuration)

0reactions
kiviewcommented, Jul 28, 2021

Thanks a lot for trying this out @kucharzyk and confirming that Testcontainers works if the Docker installation itself is clean on Fedora 34. Indeed, from reading different Reddit posts I got the feeling, that certain Docker-related settings in the system get messed up on system update (in this case I still suspect firewalld), but they get repaired on downgrade or re-installation.

Another potential culprit with Fedora is cgroups. But it seems just having a clean installation with the up-to-date packages from the official Fedora repo provide working without fiddling with configs, so that is very good to know!

Since this issue seems to be related to the Docker installation and config on Fedora, I close this issue,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to Ryuk at localhost:49154 on Docker for ...
Hi,. I am using Docker Desktop on Windows 10. Version 3.0.0 (50684) Engine: 20.10.0. Compose: 1.27.4. Kubernetes: v1.19.3. Notary: 0.6.1
Read more >
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 >
1758227 – SELinux is preventing app from connectto access ...
Description of problem: I'm trying to run a Java application that ... "Can not connect to Ryuk" Expected results: no selinux denial, ...
Read more >
Gitlab runner dind service cannot be used with Testcontainers
In the log above we can see that the "Ryuk" container started by Testcontainers to perform end-of-test cleanups, which is the first container ......
Read more >
Can not connect to Ryuk at localhost:49160 since fedora 34
Since upgrading to Fedora 34, testcontainers cant connect to ryuk anymore 2021-07-27 09:04:28.620 INFO 24831 --- [nPool-worker-19] ...
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