-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
"Can not connect to Ryuk" on CircleCI 2.0 with Docker executor #1014
Comments
I'm having exactly the same issue but using a Jenkins Docker agent. Any progress on your side @rafaelalmeida ? Thx |
Worst case, you can try to disable Ryuk to get CI working: #1181 |
@kiview Good idea. This is something I'll test tomorrow and which maybe could provide more info about the problem but in the end we'll need Ruyk, especially on a CI agent. I'll report on the chat at https://testcontainers.slack.com/archives/C1SUBPZK6/p1549555885186300 |
FTR I got this working, see #1277 |
@vmassol Nope, didn't get it working here. In #1277 it seems you got this working by opening the remote Docker port in We ended up adding code to use the Testcontainers integrations in local builds (to make it easy for developers to run tests), but allow usage of a provisioned database (controlled by environment variables). |
Effectively the problem is that the containers initiated inside CircleCI are not accessible from the main container. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
Overview
I'm trying to run a build with Testcontainers on CircleCI 2.0 with the Docker executor (not the Machine executor, as recommended by the docs, see below). The build fails with
java.lang.IllegalStateException: Can not connect to Ryuk
.My question: Is there a chance this will work?
On using CircleCI Docker executor vs Machine executor
The Testcontainers docs suggest using the
machine
executor type in CircleCI instead ofdocker
: https://www.testcontainers.org/ci/ci.html#circleci-20I have not tested this, but I assume it would work.
However, I am trying to avoid using the
machine
executor, since it has some limitations with startup time and custom images, and also "may require additional fees in a future pricing update" (source).The
docker
executor (aka "the new one") does support using Docker itself in the build (to build images, etc), by using the "Remote Docker" feature, calling thesetup_remote_docker
command in the config file.Full log of my investigation
The Docker runner in CircleCI communicates the Remote Docker host location to the running processes in the build by setting the usual env variables (
$DOCKER_HOST
, etc).Testcontainers recognizes this configuration and reports as follows:
It seems that Testcontainers is indeed able to work with this remote Docker host, since it reports having downloaded the Ruyk image:
It also shows lots of
ResponseItem.ProgressDetail
logs before that while downloading the image.I can check that it indeed download the image by SSH'ing into the build container as CircleCI allows and running
docker images
:According to the full log (reproduced below), at time
21:30:53,605
,dockerjava
issues a start container command, then almost immediately (21:30:53,924
) tries to inspect it. Then it hangs for the timeout period, 30 seconds, and spits out theSEVERE
error at21:31:23
.I've tried increasing the Ryuk timeout by setting
ryuk.container.timeout
to 120 seconds as suggested in #581. The timeout did change, because the build hanged for 2 minutes before closing with the same exception.It seems the start command never ran, because nothing is listed when I run
docker ps -a
inside the build container.I have also tried to debug Ruyk independently, running the command below as suggested by @jmaicher in #572:
docker run -p8080:8080 -v /var/run/docker.sock:/var/run/docker.sock --name ryuk -P -d quay.io/testcontainers/ryuk:0.2.2
It started, but then quits after waiting for the initial connection:
I believe it says that it was able to the Docker Engine, since if I start without mapping the socket it exits immediately with
panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
. It does not say if it's indeed reachable, since I believe Ryuk listens for messages sent by theResourceReaper
class in Testcontainers, which wasn't running at the time.I have also tried to check for port connectivity, and indeed CircleCI seems to close ports. I ran the
nginx
image mapping port80
to30080
, and triedcurl -v 35.237.241.162:30080/
, which just hangs there. So, Ryuk working in this scenario may be a problem even if the container did start.Full log and stack trace
The text was updated successfully, but these errors were encountered: