Reputation: 411
As far as i know, ryuk serves as the main independent resource handler container for other testcontainers.
I have observed unexpected behavior during the execution of integration tests in both the local environment and Jenkins using a Postgres testcontainer. Occasionally (though infrequently), I encounter the following warning message:
WARN org.testcontainers.utility.ResourceReaper - Can not connect to Ryuk at localhost:32769 java.net.SocketException: Connection reset
followed by this error
07:59:16.503 [main] ERROR org.testcontainers.utility.ResourceReaper - Timed out waiting for Ryuk container to start. Ryuk's logs:
2023/06/09 11:58:46 Pinging Docker...
2023/06/09 11:58:46 Docker daemon is available!
2023/06/09 11:58:46 Starting on port 8080...
2023/06/09 11:58:46 Started!
Once the Docker service is restarted or Ryuk is disabled, the situation returns to normal. Alternatively, the issue may resolve itself after several attempts.
I have read several threads such as
https://github.com/testcontainers/testcontainers-java/issues/3609
https://github.com/testcontainers/testcontainers-java/issues/4954
https://jira.atlassian.com/browse/BCLOUD-17236
https://github.com/testcontainers/testcontainers-java/issues/581
However, I have not identified any specific reasons explaining this behavior. Also i am a bit confused with the provided discussions, answers and closed threads without any specific solution point.
Testcontainers version is 1.15.1. Error occured on ubuntu 20.04 and Amazon linux.
Has anyone encountered a similar issue? If so, what was determined to be the cause? Additionally, are there any alternatives to Ryuk for resource reaping purposes?
Upvotes: 3
Views: 5948
Reputation: 6083
I believe your "ryuk issue" is not directly related to testcontainers
functionality, however there is a room for improvement, at least for linux hosts, the reasoning is following:
your log
07:59:16.503 [main] ERROR org.testcontainers.utility.ResourceReaper - Timed out waiting for Ryuk container to start. Ryuk's logs:
2023/06/09 11:58:46 Pinging Docker...
2023/06/09 11:58:46 Docker daemon is available!
2023/06/09 11:58:46 Starting on port 8080...
2023/06/09 11:58:46 Started!
reveals following:
ryuk
container got startedResourceReaper
has been trying to reach it during 30 seconds and failedunder "normal conditions" ryuk v0.3.0
logs should look like:
2023/06/10 15:15:45 Pinging Docker...
2023/06/10 15:15:45 Docker daemon is available!
2023/06/10 15:15:45 Starting on port 8080...
2023/06/10 15:15:45 Started!
2023/06/10 15:15:48 Connected
i.e. ryuk
container typically logs information about clients connected (last line in my listing), but your log does not contain such information, which in turn could mean following:
ResourceReaper
is broken in testcontainers v1.15.1
and it does not log enough diagnostic information (anyway, 1.15.1
version is definitely too old and it is better off updating testcontainers first)Upvotes: 1