testcontainers-java: Codeship builds fail: `can not connect to Ryuk`
TestContainers works locally. Builds on Codeship fail with the following:
2018-02-10_19:22:35.027 WARN o.t.utility.ResourceReaper - Can not connect to Ryuk at 172.17.0.1:32768
java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:134)
at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:136)
at java.lang.Thread.run(Thread.java:748)
2018-02-10_19:22:35.044 WARN o.t.utility.ResourceReaper - Can not connect to Ryuk at 172.17.0.1:32768
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.testcontainers.utility.ResourceReaper.lambda$start$2(ResourceReaper.java:139)
at java.lang.Thread.run(Thread.java:748)
I do not use volume mapping for this service, but I use volumes to build other services. My understanding of https://www.testcontainers.org/usage/inside_docker.html is that I do not need to mount the Docker socket volume.
I’ve set add_docker: true in my codeship-services.yml, which does the following:
Add the environment variables DOCKER_HOST, DOCKER_TLS_VERIFY and DOCKER_CERT_PATH from the host. If DOCKER_CERT_PATH is set, it will mount the certificate directory through to the container. See add_docker for an example using Docker-in-Docker.
https://documentation.codeship.com/pro/builds-and-configuration/services/
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 25 (15 by maintainers)
I’ve created a pull request that should fix the issue. See #843.
Reopened as requested, bug seems to be still present.
@guss See the docs on custom properties.
As a side note for @kiview and @bsideup, it would be nice to have
ryuk.container.timeout(or any other missing properties) added to that page for a complete reference.Thanks for the ping - I forgot to follow up on this.
We were still experiencing the problem with
1.9.0-rc1, and have setryuk.container.timeout=120property since. This appears to have fixed it, but we’ve also had some updated on this infrastructure side and have upgrade to1.9.1since.I’ll try to remove
ryuk.container.timeout=120some time this week and see how it behaves, just to try and isolate the problem.We’re experiencing the same when the load on the build server (Jenkins) is (very) high.
One thing that eased the pain was upgrading docker where we used to use an early version of 2017. The docker service wasn’t responsive during peak testing (eight parallel test runs) which lead me to that direction.
Still, we had to reduce the number of parallel builds because of testcontainer timeouts. I haven’t tried to increase
ryuk.container.timeoutbecause IMO thirty seconds should be enough - also in a high load scenario.Sorry about the weird link, Github is sometimes too enthusiastic about referencing issues.
I’ve tried with setting the timeout to 120, and indeed the build takes 2 more minutes but the Ryuk connection still fails:
I’m having the same issue with version 1.8.1 Codeship pro,
add_docker=true,ryuk.container.timeout = 120