-
-
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
Ryuk container name already in use #2395
Comments
Also affected by this. Same setup. |
Affected by this using version 1.13.0 |
My tests worked fine on |
For information, we've got the same issue with an ElasticSearch container. Worked great with version 1.10.6 but ran into this bug when we upgraded to 1.13.0 |
The issue seems to be fixed in |
I am facing the same issue on version |
For everyone who is getting the issue: Also, make sure you're pasting the full exception, not just the message. |
@bsideup Test Configuration
Please let me know if anything more is required |
Can others confirm that they use JUnit 5 and/or |
i'm using junit5 as well. not the extension that ships with the library, we wrote out own, but it is junit5. |
Update: |
@bsideup I recently hit this error and we are using JUnit 4 and are not using Startables.deepStart. Here is how the container is defined: @ClassRule
public static CouchDBContainer couchdb = new CouchDBContainer(new ImageFromDockerfile()
.withDockerfileFromBuilder(builder -> builder.from("couchdb:1.7")
.copy("/opt/couchdb/etc/local.d/testcontainers_config.ini", "/opt/couchdb/etc/local.d/testcontainers_config.ini")
.copy("/etc/couchdb/cert/couchdb.pem", "/etc/couchdb/cert/couchdb.pem")
.copy("/etc/couchdb/cert/privkey.pem", "/etc/couchdb/cert/privkey.pem")
.build())
.withFileFromFile("/opt/couchdb/etc/local.d/testcontainers_config.ini", new File("lib/LibertyFATTestFiles/couchdb-config/testcontainers_config.ini"), 644)
.withFileFromFile("/etc/couchdb/cert/couchdb.pem", new File("lib/LibertyFATTestFiles/ssl-certs/couchdb.pem"), 644)
.withFileFromFile("/etc/couchdb/cert/privkey.pem", new File("lib/LibertyFATTestFiles/ssl-certs/privkey.pem"), 644))
.withLogConsumer(FATSuite::log); Here is a link to the src with additional context: And here is the complete stack trace (notice that it is all stemming from a logging statement in
|
@bsideup so I guess my findings are sort of along the same lines as I think that if we simply removed that log statement it would fix the issue, but maybe the code needs a more thorough review for |
@aguibert FYI I just submitted #2930 that should fix eager resolve of BTW from the stacktrace, it looks like you're using a version that is older that 1.14.x, consider updating. |
hmm, we're using 1.14.0, not the latest, but it is 1.14.X |
Okay, after looking at the code, I noticed that we were not caching Ryuk's failure: #2935 So, the actual problem was that This logs confirms that:
|
Desperately awaiting a release version with these fixes included (Jenkins here). |
@enote-kane well, what was fixed won't fix your Jenkins issue. There is still an issue with "failed to connect to Ryuk" on your environment, just now it will be clear (before, it was hidden behind "container name already in use" because it was trying to make another attempt at starting Ryuk but it was already running (but failed to connect to it) |
@bsideup Oh, that's bad. I was wondering why this is the case only on our EC2 Jenkins slaves running Ubuntu whereas we also have other Ubuntu clients where we where unable to reproduce this issue at all. |
@enote-kane there are no known bugs with Ryuk. Please check your network settings, firewall, debug connectivity, etc etc. |
@bsideup Hm, I am confused as I wasn't able to spot any connectivity issues in my log output, but will try to have more debug logging. |
OK, after looking again, I think you mean this, right?
But I don't get why this should be different when run by a Jenkins pipeline than any such other environment (docker-in-docker). The actual command that is being executed is like this: docker run -t -u 1001:1001 --network=bridge \
-v /var/run/docker.sock:/var/run/docker.sock \
-u 1001:999 # jenkins user ID + docker group ID \
-w /opt/jenkins/workspace/... \
-v /opt/jenkins/workspace/...:/opt/jenkins/workspace/...:rw,z \
-v /opt/jenkins/workspace/...@tmp:/opt/jenkins/workspace/...@tmp:rw,z \
-e ... \
maven:3-openjdk-14 \
mvn --batch-mode --strict-checksums test -DtrimStackTrace=false So the only thing I could think of is the standard |
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. |
Please reopen. I am having this issue on a very uncomplicated "hello world" type of project, rendering the TestContainers library unusable at the moment.
My Gradle build file:
My machine is a Hyper-V virtual machine (Windows 10 x64) running Docker (20.10.5) on WSL2 (which technically becomes a nested VM). WSL2's distro is Ubuntu 20.04. |
The error message from docker is:
Based on looking through the code, you are creating a static
SESSION_ID
in theDockerClientFactory
but you are creating a Ryuk container per docker client. There isn't a check for an existing container with that id.I'm not sure what the correct solution is. The 2 options I see are:
We are using version 1.12.5
This happens during CI builds using docker-in-docker on BuildKite. EC2 hosts running Amazon Linux. Does not happen locally on macOS or on linux laptops.
The text was updated successfully, but these errors were encountered: