-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
[Bug] Failed to connect to Reaper from 9.0.1 #439
Comments
Same problem here, 9.0.0 is just hiding the error, but not resolving the issue. Locally, everything works ok. I'm having this problem in Gitlab CI Docker Runner (i'm doing docker-in-docker, mapping docker sock to host), seems to be related to concurrent instances (but i'm not sure). 2023-01-19T09:56:16.492Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: 2023/01/19 09:56:16 Pinging Docker...
2023-01-19T09:56:16.498Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: 2023/01/19 09:56:16 Docker daemon is available!
2023-01-19T09:56:16.499Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: 2023/01/19 09:56:16 Starting on port 8080...
2023-01-19T09:56:16.499Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: 2023/01/19 09:56:16 Started!
2023-01-19T09:56:16.506Z testcontainers DEBUG Waiting for container to be ready: 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17
2023-01-19T09:56:16.508Z testcontainers DEBUG Waiting for log message "/.+ Started!/"
2023-01-19T09:56:16.520Z testcontainers INFO Container is ready
2023-01-19T09:56:16.520Z testcontainers DEBUG Connecting to Reaper (attempt 1) 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17 on 172.17.0.1:32790
2023-01-19T09:57:16.490Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: panic: Timed out waiting for the first connection
2023-01-19T09:57:16.491Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17:
2023-01-19T09:57:16.491Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: goroutine 1 [running]:
2023-01-19T09:57:16.491Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: main.main()
2023-01-19T09:57:16.491Z testcontainers:containers TRACE 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17: /go/src/github.com/testcontainers/moby-ryuk/main.go:50 +0x449
2023-01-19T09:58:27.315Z testcontainers ERROR Reaper 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17 socket error: Error: connect ETIMEDOUT 172.17.0.1:32790
2023-01-19T09:58:27.315Z testcontainers ERROR Connection to Reaper 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17 closed with error
reason: Failed to connect to Reaper 772ad226bab09bf7c9c1927c8a0245df09d9475f8e6c4b0430cb9e1460d65d17
at .../.pnpm/[email protected]/node_modules/testcontainers/dist/reaper.js:126:56
at IntervalRetryStrategy.<anonymous> (.../.pnpm/[email protected]/node_modules/testcontainers/dist/retry-strategy.js:37:28)
at Generator.next (<anonymous>)
at fulfilled (.../.pnpm/[email protected]/node_modules/testcontainers/dist/retry-strategy.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
|
SEO: I had the same problem when using testcontainers-node 9.1.1 together with Colima. The problem was that colima didn't support Also commented here: abiosoft/colima#583 |
It's possible I've reproduced the issue in the pipeline (https://github.com/testcontainers/testcontainers-node/actions/runs/4293412705/jobs/7481054866), I will try to look into this. If anyone is able to reproduce this consistently or can point me in some direction I'd be very grateful! |
Wanted to give an update. The issue isn't with the Reaper. It is related to this issue: moby/moby#42442. When IPv6 is enabled, Docker will generate a port binding for both When the Docker host is There's a couple of things we can do here:
I'm currently in discussion with other TC maintainers to come up with the best solution. Watch this space! |
Expected Behaviour
Expected behaviour is that the reaper connects as it did in 9.0.0 and prior. I have stress tested older versions with multiple test-re-runs in the same environment and don't have any issues.
Actual Behaviour
Receive error log:
Failed to connect to Reaper [id]
, internally it follows multiple retries andconnect ECONNREFUSED ::1:32790
.I believe it is as a result of this "patch" https://github.com/testcontainers/testcontainers-node/pull/412/files which has caused some kind of socket issue, though I am not sure specifically what is causing it within this code change
Testcontainer Logs
Steps to Reproduce
Ensure using testcontainer version
9.0.1
or later.Running testcontainers with simple Postgres and Redis startups defined by the following functions, we get infrequent issues with the testcontainer startup causing a test suite failure.
It does not happen consistently, perhaps 20% of the time. I also have not been able to replicate this locally.
Environment Information
Issue only appears after upgrading to 9.0.1 containing this PR. Issue is resolved when downgrading to 9.0.0 or lower:
https://github.com/testcontainers/testcontainers-node/pull/412/files
The text was updated successfully, but these errors were encountered: