testcontainers / testcontainers/testcontainers-java

[Centos 7] ContainerLaunchException: Timed out waiting for container port to open (0.0.0.0 ports: [32807] should be listening)

Open
#791 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

resolution/acknowledged
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

@ClassRule
public static GenericContainer myum = new GenericContainer("myum:latest")
.withExposedPorts(11111)
.waitingFor(Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(240)));

while running the junit I see the following ,
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ℹ︎ Checking the system...
✔ Docker version should be at least 1.6.0
✔ Docker environment should have more than 2GB free disk space
✔ File should be mountable
2018-07-18 15:00:56,007 ERROR (org.testcontainers.shaded.io.netty.util.ResourceLeakDetector) [testcontainers-netty-1-8] - LEAK: ByteBuf.release() was not called before it's garbage-collected. Enable advanced leak reporting to find out where the leak occurred. To enable advanced leak reporting, specify the JVM option '-Dorg.testcontainers.shaded.io.netty.leakDetection.level=advanced' or call ResourceLeakDetector.setLevel() See http://netty.io/wiki/reference-counted-objects.html for more information.

Test ignored.

org.testcontainers.containers.ContainerLaunchException: Container startup failed

at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:231)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:209)
at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:690)
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.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:224)
... 10 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:297)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:226)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
... 11 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (0.0.0.0 ports: [32807] should be listening)
at org.testcontainers.containers.wait.strategy.HostPortWaitStrategy.waitUntilReady(HostPortWaitStrategy.java:47)
at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:32)
at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:559)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:276)
... 13 more

Process finished with exit code 255

BUILD DETAILS
testcontainers1.8.1
Docker version 17.03.2-ce, build f5ec1e2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GenericContainer.java and HostPortWaitStrategy.java at the stack-trace locations, using the JUnit example, Testcontainers 1.8.1, Docker 17.03.2-ce, and CentOS 7 environment described here. Reproduce the port-wait timeout and trace why the exposed container port is not detected; done means the reported startup failure is explained and covered by a passing regression test or a documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.