You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi i have a problem with DockerComposeContainer, it fails with the following exception:
org.testcontainers.containers.ContainerLaunchException: Container startup failed
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:217)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:199)
at org.testcontainers.containers.DockerComposeContainer.startAmbassadorContainers(DockerComposeContainer.java:243)
at org.testcontainers.containers.DockerComposeContainer.start(DockerComposeContainer.java:153)
at org.testcontainers.containers.DockerComposeContainer.starting(DockerComposeContainer.java:121)
at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:210)
... 14 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:277)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:212)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
... 15 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container lpotl4i5hv8g_git-server_1 as it
not running
at org.testcontainers.containers.GenericContainer.applyConfiguration(GenericContainer.java:468)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:228)
... 17 more
This issue only happens on some of our developers environment, and we think is related to different docker versions.
We have been debugging the problem and have discovered that in newer version docker compose creates containers with a different container name than it is expected from testcontainers:
where the issue is present started container is named: lpotl4i5hv8g_git-server_1_edb471beb444
notice the hash at the end.
debugging further in the code i noticed that GenericContainer filters containers like this:
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.
Hi i have a problem with DockerComposeContainer, it fails with the following exception:
This issue only happens on some of our developers environment, and we think is related to different docker versions.
We have been debugging the problem and have discovered that in newer version docker compose creates containers with a different container name than it is expected from testcontainers:
where the issue is present started container is named: lpotl4i5hv8g_git-server_1_edb471beb444
notice the hash at the end.
debugging further in the code i noticed that GenericContainer filters containers like this:
this method
findAllNetworksForLinkedContainers
has the same problem,i could fix this in my project by copy-pasting the GenericContainer code and replacing
.filter(name -> name.endsWith(linkableContainer .getContainerName()))
with
.filter(name -> name.contains(linkableContainer .getContainerName()))
Can you please fix this?
i'm available to provide a pull request if needed.
Docker versions where it doesn't work:
docker-compose.yml
and this is the code that i use to start the compose:
i reproduced the problem with version 1.8.0 and the latest 1.11.1
The text was updated successfully, but these errors were encountered: