Skip to content
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]: Container fails to start after upgrade from 1.18.1 to 1.18.2 #7082

Closed
zhemaituk opened this issue May 30, 2023 · 38 comments
Closed

[Bug]: Container fails to start after upgrade from 1.18.1 to 1.18.2 #7082

zhemaituk opened this issue May 30, 2023 · 38 comments
Labels

Comments

@zhemaituk
Copy link

Module

PostgreSQL

Testcontainers version

1.18.2

Using the latest Testcontainers version?

Yes

Host OS

MacOS Ventura 13.4

Host Arch

ARM (Apple M2)

Docker version

Client:
 Cloud integration: v1.0.33
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:16 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.20.0 (109717)
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:50:59 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

After upgrading org.testcontainers:postgresql dependency from 1.18.1 to 1.18.2 tests fail to run.

Failure happens in .start method:

PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:15.2");
postgres.start();

Relevant log output

2023-05-30 17:09:31  INFO  ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2023-05-30 17:09:31  INFO  DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2023-05-30 17:09:32  INFO  DockerClientProviderStrategy - Found Docker environment with Testcontainers Host with tc.host=unix:///Users/andrei/.docker/run/docker.sock
2023-05-30 17:09:32  INFO  DockerClientFactory - Docker host IP address is localhost
2023-05-30 17:09:32  INFO  DockerClientFactory - Connected to docker: 
  Server Version: 24.0.2
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7851 MB
2023-05-30 17:09:32  INFO  1 - Pulling docker image: testcontainers/ryuk:0.5.1. Please be patient; this may take some time but only needs to be done once.
2023-05-30 17:09:32  INFO  RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for https://index.docker.io/v1/
2023-05-30 17:09:32  INFO  1 - Starting to pull image
2023-05-30 17:09:32  INFO  1 - Pulling image layers:  0 pending,  0 downloaded,  0 extracted, (0 bytes/0 bytes)
2023-05-30 17:09:33  INFO  1 - Pulling image layers:  2 pending,  1 downloaded,  0 extracted, (304 KB/? MB)
2023-05-30 17:09:33  INFO  1 - Pulling image layers:  2 pending,  1 downloaded,  1 extracted, (2 MB/? MB)
2023-05-30 17:09:33  INFO  1 - Pulling image layers:  2 pending,  1 downloaded,  2 extracted, (2 MB/? MB)
2023-05-30 17:09:33  INFO  1 - Pulling image layers:  1 pending,  2 downloaded,  2 extracted, (2 MB/? MB)
2023-05-30 17:09:33  INFO  1 - Pulling image layers:  1 pending,  2 downloaded,  3 extracted, (5 MB/? MB)
2023-05-30 17:09:33  INFO  1 - Creating container for image: testcontainers/ryuk:0.5.1
2023-05-30 17:09:33  INFO  1 - Container testcontainers/ryuk:0.5.1 is starting: 70f4088e24cda89ca1ab5c0a7218b977b519920bdcbee8b292e6b3fb1af81795
2023-05-30 17:09:33  ERROR 1 - Could not start container
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: 70f4088e24cda89ca1ab5c0a7218b977b519920bdcbee8b292e6b3fb1af81795"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:31) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:13) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.command.InspectContainerCmdImpl.exec(InspectContainerCmdImpl.java:52) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.lambda$tryStart$1(GenericContainer.java:456) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.lambda$new$0(AbstractHamcrestCondition.java:48) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235) ~[testcontainers-1.18.2.jar:1.18.2]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at org.testcontainers.shaded.org.awaitility.core.SameThreadExecutorService.execute(SameThreadExecutorService.java:79) ~[testcontainers-1.18.2.jar:1.18.2]
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[?:?]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:101) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.await(AbstractHamcrestCondition.java:86) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:691) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:708) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:455) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344) ~[testcontainers-1.18.2.jar:?]
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81) ~[duct-tape-1.0.8.jar:?]
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104) ~[testcontainers-1.18.2.jar:1.18.2]
	at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109) ~[docker-java-api-3.3.0.jar:?]
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321) ~[testcontainers-1.18.2.jar:?]
	at com.breakingequity.marketdata.database.TestDatabase.init(TestDatabase.java:26) ~[test-classes/:?]
.....


2023-05-30 17:09:33  ERROR 1 - There are no stdout/stderr logs available for the failed container

org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.5.1

	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:349)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)
	at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
	at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
	at com.breakingequity.marketdata.database.TestDatabase.init(TestDatabase.java:26)
....
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334)
	... 80 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:553)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 81 more
Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: 70f4088e24cda89ca1ab5c0a7218b977b519920bdcbee8b292e6b3fb1af81795"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:31)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:13)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.InspectContainerCmdImpl.exec(InspectContainerCmdImpl.java:52)
	at org.testcontainers.containers.GenericContainer.lambda$tryStart$1(GenericContainer.java:456)
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.lambda$new$0(AbstractHamcrestCondition.java:48)
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248)
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.testcontainers.shaded.org.awaitility.core.SameThreadExecutorService.execute(SameThreadExecutorService.java:79)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:101)
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.await(AbstractHamcrestCondition.java:86)
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985)
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:691)
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:708)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:455)
	... 83 more

Additional Information

No response

@eddumelendez
Copy link
Member

Have you set tc.host property manually in ~/.testcontainers.properties?

@zhemaituk
Copy link
Author

Nope, didn't touch that file:

cat ~/.testcontainers.properties
#Modified by Testcontainers
#Tue Aug 09 20:35:36 EDT 2022
docker.client.strategy=org.testcontainers.dockerclient.UnixSocketClientProviderStrategy

@zhemaituk
Copy link
Author

But following this clue you gave: if I do modify and manually add tc.host=127.0.0.1 tests do work :)

@eddumelendez
Copy link
Member

Do you have /var/run/docker.sock? which Docker Desktop for Mac version are you using?

What if you delete the ~/.testcontainers.properties and run the test again?

@zhemaituk
Copy link
Author

I have latest docker desktop as in the original report (Docker Desktop 4.20.0; Engine 24.0.2).

ls -la /var/run/docker.sock
lrwxr-xr-x@ 1 root  daemon  37 May 25 17:29 /var/run/docker.sock -> /Users/andrei/.docker/run/docker.sock

If I delete the file, I either immediately get the same error as reported originally, and sometimes such error after 1 min:

2023-05-30 18:00:48  WARN  TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/Users/andrei/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /Users/andrei/.testcontainers.properties (No such file or directory)
2023-05-30 18:00:48  INFO  ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2023-05-30 18:00:48  INFO  DockerClientProviderStrategy - Found Docker environment with Testcontainers Host with tc.host=unix:///Users/andrei/.docker/run/docker.sock
2023-05-30 18:00:48  INFO  DockerClientFactory - Docker host IP address is localhost
2023-05-30 18:00:48  INFO  DockerClientFactory - Connected to docker: 
  Server Version: 24.0.2
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7851 MB
2023-05-30 18:00:48  INFO  1 - Creating container for image: testcontainers/ryuk:0.5.1
2023-05-30 18:00:48  INFO  RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for https://index.docker.io/v1/
2023-05-30 18:00:48  INFO  1 - Container testcontainers/ryuk:0.5.1 is starting: e93a2eb12643f25839884a8360baab9421fed5e97aa89f81c1fee8ea24d5afd3
2023-05-30 18:01:49  ERROR 1 - Could not start container
java.lang.IllegalStateException: Wait strategy failed. Container is removed
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:501) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344) ~[testcontainers-1.18.2.jar:?]
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81) ~[duct-tape-1.0.8.jar:?]
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104) ~[testcontainers-1.18.2.jar:1.18.2]
	at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109) ~[docker-java-api-3.3.0.jar:?]
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321) ~[testcontainers-1.18.2.jar:?]
	at com.breakingequity.marketdata.udf.TestLiveDatabase.init(TestLiveDatabase.java:30) ~[test-classes/:?]
....
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Started.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:964) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:490) ~[testcontainers-1.18.2.jar:?]
	... 87 more
2023-05-30 18:01:49  ERROR 1 - There are no stdout/stderr logs available for the failed container

org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.5.1

	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:349)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)
	at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
	at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
	at com.breakingequity.marketdata.udf.TestLiveDatabase.init(TestLiveDatabase.java:30)
....
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334)
	... 84 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:553)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 85 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container is removed
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:501)
	... 87 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Started.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:964)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:490)
	... 87 more


org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.5.1

	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:349)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)
	at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
	at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)
	at com.breakingequity.marketdata.udf.TestLiveDatabase.init(TestLiveDatabase.java:30)
....
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334)
	... 84 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:553)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 85 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container is removed
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:501)
	... 87 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Started.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:964)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:490)
	... 87 more

Note: using 1.18.1 works no problem with or without the file. In logs with 1.18.1 I still see localhost, but tests complete successfully:
2023-05-30 17:57:30 INFO DockerClientFactory - Docker host IP address is localhost

@eddumelendez
Copy link
Member

Thanks! weird! I just deleted my ~/.testcontainers.properties and it worked as expected

00:20:27.235 WARN  org.testcontainers.utility.TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/Users/eddumelendez/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /Users/eddumelendez/.testcontainers.properties (No such file or directory)
00:20:27.240 INFO  org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
00:20:27.387 WARN  org.testcontainers.dockerclient.DockerClientProviderStrategy - DOCKER_HOST tcp://127.0.0.1:62024/0 is not listening
00:20:27.576 INFO  org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
00:20:27.582 INFO  org.testcontainers.DockerClientFactory - Docker host IP address is localhost
00:20:27.605 INFO  org.testcontainers.DockerClientFactory - Connected to docker: 
  Server Version: 23.0.5
  API Version: 1.42
  Operating System: Docker Desktop
  Total Memory: 7851 MB

and if I disable Default Docker socker in Docker Desktop I get

00:23:08.247 INFO  org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Rootless Docker accessed via Unix socket (/Users/eddumelendez/.docker/run/docker.sock)

which is expected 😕

@zhemaituk
Copy link
Author

Also tried ryuk.container.image = testcontainers/ryuk:0.4.0 with 1.18.2 - same problem (both 0.4.0 and 0.5.1 do work fine with 1.18.1).

While test is running I am able to "catch" ryuk container for a split-second:
06754731c95e testcontainers/ryuk:0.5.1 "/bin/ryuk" Less than a second ago Created testcontainers-ryuk-2ab4a986-0982-4f75-a65c-304c34ceb93c
Next moment it's gone, test either fails or times out.

Is there a way to trace anything further? or replicate what testcontainers doing in command line, which I could try?

Overall your guess about host seems relevant (when I explicitly set tc.host=127.0.0.1, it helps).

@eddumelendez
Copy link
Member

I am wondering about 2023-05-30 18:00:48 INFO DockerClientProviderStrategy - Found Docker environment with Testcontainers Host with tc.host=unix:///Users/andrei/.docker/run/docker.sock , which doesn't make sense at all 🤔 . It only applies when tc.host is explicitly declared in ~/.testcontainers.properties

@zhemaituk
Copy link
Author

Interesting.
When I stop at line 31-32 of TestcontainersHostPropertyClientProviderStrategy in debug after:

        Optional<String> tcHost = Optional.ofNullable(
            TestcontainersConfiguration.getInstance().getUserProperty("tc.host", null)
        );

tcHost variable is Optional.empty, so it's coming from somewhere else, will keep you posted if I notice something else.

@zhemaituk
Copy link
Author

zhemaituk commented May 30, 2023

Got to this point:

lambda$resolveDockerHost$0:478, DefaultDockerClientConfig$Builder (org.testcontainers.shaded.com.github.dockerjava.core)
apply:-1, DefaultDockerClientConfig$Builder$$Lambda$486/0x000000080136d5f0 (org.testcontainers.shaded.com.github.dockerjava.core)
flatMap:289, Optional (java.util)
resolveDockerHost:478, DefaultDockerClientConfig$Builder (org.testcontainers.shaded.com.github.dockerjava.core)
build:462, DefaultDockerClientConfig$Builder (org.testcontainers.shaded.com.github.dockerjava.core)
<init>:32, TestcontainersHostPropertyClientProviderStrategy (org.testcontainers.dockerclient)
<init>:23, TestcontainersHostPropertyClientProviderStrategy (org.testcontainers.dockerclient)
newInstance0:-1, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:77, NativeConstructorAccessorImpl (jdk.internal.reflect)
newInstance:45, DelegatingConstructorAccessorImpl (jdk.internal.reflect)
newInstanceWithCaller:499, Constructor (java.lang.reflect)
newInstance:480, Constructor (java.lang.reflect)
newInstance:789, ServiceLoader$ProviderImpl (java.util)
get:729, ServiceLoader$ProviderImpl (java.util)
next:1403, ServiceLoader$3 (java.util)
forEach:74, Iterable (java.lang)
getOrInitializeStrategy:148, DockerClientFactory (org.testcontainers)
client:191, DockerClientFactory (org.testcontainers)
getDockerClient:104, DockerClientFactory$1 (org.testcontainers)
authConfig:109, DockerClientDelegate (com.github.dockerjava.api)
start:321, GenericContainer (org.testcontainers.containers)
init:30, TestLiveDatabase (com.breakingequity.marketdata.udf)

And the method effectively returns URI.create("unix:///var/run/docker.sock") from the .orElse block.

Update:
And this value ends up set in TestcontainersHostPropertyClientProviderStrategy.dockerClientConfig.getDockerHost, and subsequently printed in #getDescription. Somewhat puzzling that you don't see the same behavior.

@zhemaituk
Copy link
Author

Trace logs if it helps with anything. It sounds like Trying out strategy: TestcontainersHostPropertyClientProviderStrategy not supposed to be successful, or maybe TestcontainersHostPropertyClientProviderStrategy.isApplicable() should return false if tc.host is not set.

2023-05-30 19:20:12  DEBUG TestcontainersConfiguration - Testcontainers configuration overrides will be loaded from file:/Users/andrei/.testcontainers.properties
2023-05-30 19:20:12  WARN  TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/Users/andrei/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /Users/andrei/.testcontainers.properties (No such file or directory)
2023-05-30 19:20:12  INFO  ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2023-05-30 19:20:13  DEBUG DockerClientProviderStrategy - Trying out strategy: TestcontainersHostPropertyClientProviderStrategy
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: 
2023-05-30 19:20:13  INFO  DockerClientProviderStrategy - Found Docker environment with Testcontainers Host with tc.host=unix:///Users/andrei/.docker/run/docker.sock
2023-05-30 19:20:13  DEBUG DockerClientProviderStrategy - Transport type: 'httpclient5', Docker host: 'unix:///Users/andrei/.docker/run/docker.sock'
2023-05-30 19:20:13  DEBUG DockerClientProviderStrategy - Checking Docker OS type for Testcontainers Host with tc.host=unix:///Users/andrei/.docker/run/docker.sock
2023-05-30 19:20:13  INFO  DockerClientFactory - Docker host IP address is localhost
2023-05-30 19:20:13  DEBUG DockerClientFactory - Docker info: {NGoroutines=75, Name=docker-desktop, Swarm={NodeID=, NodeAddr=, LocalNodeState=inactive, ControlAvailable=false, Error=, RemoteManagers=null}, RuncCommit={ID=v1.1.7-0-g860f061, Expected=v1.1.7-0-g860f061}, OSVersion=, Runtimes={io.containerd.runc.v2={path=runc}, runc={path=runc}}, ID=5d444cff-2173-485b-b412-c03e6e280e6c, DriverStatus=[[Backing Filesystem, extfs], [Supports d_type, true], [Using metacopy, false], [Native Overlay Diff, true], [userxattr, false]], BridgeNfIptables=true, LiveRestoreEnabled=false, SystemTime=2023-05-30T23:20:13.105550918Z, NoProxy=hubproxy.docker.internal, Architecture=aarch64, NEventsListener=14, HttpsProxy=http.docker.internal:3128, Images=35, ContainersRunning=0, Labels=[], InitCommit={ID=de40ad0, Expected=de40ad0}, NFd=48, KernelVersion=5.15.49-linuxkit-pr, LoggingDriver=json-file, OSType=linux, SecurityOptions=[name=seccomp,profile=builtin, name=cgroupns], ContainerdCommit={ID=3dce8eb055cbb6872793272b4f20ed16117344f8, Expected=3dce8eb055cbb6872793272b4f20ed16117344f8}, GenericResources=null, OperatingSystem=Docker Desktop, RegistryConfig={AllowNondistributableArtifactsCIDRs=null, AllowNondistributableArtifactsHostnames=null, InsecureRegistryCIDRs=[127.0.0.0/8], IndexConfigs={docker.io={Name=docker.io, Mirrors=[], Secure=true, Official=true}, hubproxy.docker.internal:5555={Name=hubproxy.docker.internal:5555, Mirrors=[], Secure=false, Official=false}}, Mirrors=null}, ServerVersion=24.0.2, OomKillDisable=false, CpuCfsQuota=true, Containers=3, Driver=overlay2, IPv4Forwarding=true, ExperimentalBuild=false, DockerRootDir=/var/lib/docker, CPUSet=true, CpuCfsPeriod=true, DefaultRuntime=runc, CPUShares=true, Debug=false, NCPU=4, Plugins={Volume=[local], Network=[bridge, host, ipvlan, macvlan, null, overlay], Authorization=null, Log=[awslogs, fluentd, gcplogs, gelf, journald, json-file, local, logentries, splunk, syslog]}, SwapLimit=true, CgroupDriver=cgroupfs, ContainersPaused=0, MemTotal=8232951808, IndexServerAddress=https://index.docker.io/v1/, MemoryLimit=true, HttpProxy=http.docker.internal:3128, InitBinary=docker-init, CgroupVersion=2, PidsLimit=true, Isolation=, BridgeNfIp6tables=true, Warnings=null, ContainersStopped=3}
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: 
2023-05-30 19:20:13  TRACE VersionCmdExec - GET: DefaultWebTarget{path=[/version], queryParams={}}
2023-05-30 19:20:13  DEBUG DockerClientFactory - Docker version: {Components=[{Name=Engine, Version=24.0.2, Details={ApiVersion=1.43, Arch=arm64, BuildTime=2023-05-25T21:50:59.000000000+00:00, Experimental=false, GitCommit=659604f, GoVersion=go1.20.4, KernelVersion=5.15.49-linuxkit-pr, MinAPIVersion=1.12, Os=linux}}, {Name=containerd, Version=1.6.21, Details={GitCommit=3dce8eb055cbb6872793272b4f20ed16117344f8}}, {Name=runc, Version=1.1.7, Details={GitCommit=v1.1.7-0-g860f061}}, {Name=docker-init, Version=0.19.0, Details={GitCommit=de40ad0}}], KernelVersion=5.15.49-linuxkit-pr, ApiVersion=1.43, Platform={Name=Docker Desktop 4.20.0 (109717)}, GitCommit=659604f, Os=linux, Version=24.0.2, MinAPIVersion=1.12, Arch=arm64, GoVersion=go1.20.4, BuildTime=2023-05-25T21:50:59.000000000+00:00}
2023-05-30 19:20:13  INFO  DockerClientFactory - Connected to docker: 
  Server Version: 24.0.2
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7851 MB
2023-05-30 19:20:13  DEBUG RyukResourceReaper - Ryuk is enabled
2023-05-30 19:20:13  DEBUG PrefixingImageNameSubstitutor - No prefix is configured
2023-05-30 19:20:13  DEBUG ImageNameSubstitutor - Did not find a substitute image for testcontainers/ryuk:0.5.1 (using image substitutor: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor'))
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: ListImagesCmdImpl[filters=org.testcontainers.shaded.com.github.dockerjava.core.util.FiltersBuilder@0,imageNameFilter=<null>,showAll=false]
2023-05-30 19:20:13  TRACE ListImagesCmdExec - GET: DefaultWebTarget{path=[/images/json], queryParams={}}
2023-05-30 19:20:13  TRACE ListImagesCmdExec - Response: [Image(created=1684736039, id=sha256:3233a1adb20f4dad18b52010a1ed4d5c2b4062afdd9d54d924615e93aeaa1cbc, parentId=, repoTags=[timescale/timescaledb:latest-pg15], repoDigests=[timescale/timescaledb@sha256:706f81062db378ba80648ffd55fbbca679682c2bdb460579fd112dc348b1c85d], size=424455423, virtualSize=424455423, sharedSize=-1, labels={maintainer=Timescale https://www.timescale.com}, containers=-1), Image(created=1684336517, id=sha256:8be3fdcaa3e89af39fed008cb8812a360bc4aae7098c708363ad773b4ea83315, parentId=, repoTags=[testcontainers/ryuk:0.5.1], repoDigests=[testcontainers/ryuk@sha256:533abc56c07b52a26c955d1e7ae428d810582ab01c156384ae79960eb5fa0775], size=12171500, virtualSize=12171500, sharedSize=-1, labels={org.testcontainers.ryuk=true}, containers=-1), Image(created=1682955224, id=sha256:ee8803fa6bec933f333b282a12711ada18d4192bc0659b9716f9cdc2f382fd0e, parentId=, repoTags=[aws-lambda-layer:latest], repoDigests=null, size=2590103021, virtualSize=2590103021, sharedSize=-1, labels=null, containers=-1), Image(created=1682952998, id=sha256:585e163b6714e4bfc470827445980ad29d15557f57a6ef7147e7a5a03cd91ead, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2586599346, virtualSize=2586599346, sharedSize=-1, labels=null, containers=-1), Image(created=1682952902, id=sha256:f55be2ace579e55fa58e03713de7b8d7512d99fb1f7fb729e19380bb7ae2d0fe, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2586600421, virtualSize=2586600421, sharedSize=-1, labels=null, containers=-1), Image(created=1682914467, id=sha256:b10178d65825fb12413c46fcfa41f24e112cefc9dfab4e33bb4fc5301b01f994, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2438023385, virtualSize=2438023385, sharedSize=-1, labels=null, containers=-1), Image(created=1682913668, id=sha256:a674baf2551d156eb858979d94caa535bb8f780afe35115dc0b39f02ebeef0ce, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2422696656, virtualSize=2422696656, sharedSize=-1, labels=null, containers=-1), Image(created=1682912806, id=sha256:9909584f00bddfef703e0d75b73f69d633de4c72af020165a6109fcee7b85719, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2422696656, virtualSize=2422696656, sharedSize=-1, labels=null, containers=-1), Image(created=1682912788, id=sha256:c4db4259001356b90b8a59f7f6ee7a09015de34d7d7ce5c117ab0f6597c0988a, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2422696656, virtualSize=2422696656, sharedSize=-1, labels=null, containers=-1), Image(created=1682909834, id=sha256:e0adb4f2e6f7a5a9f1baa58d67927fe087f7eabf352d40bc32d7279c3668b710, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=1225997411, virtualSize=1225997411, sharedSize=-1, labels=null, containers=-1), Image(created=1682906530, id=sha256:9adc3adbcb1e2f7711fe39b8d8ed674df741d79179639f92418670867938ba95, parentId=, repoTags=[<none>:<none>], repoDigests=[<none>@<none>], size=2453372575, virtualSize=2453372575, sharedSize=-1, labels=null, containers=-1), Image(created=1682168186, id=sha256:870367b3e855020b236f8fa47950445c55ca4236e92a6bc1d755ff8ab74eae87, parentId=, repoTags=[public.ecr.aws/o6r2q6p9/buildx-python-nodejs-aws:0.1.0], repoDigests=[public.ecr.aws/o6r2q6p9/buildx-python-nodejs-aws@sha256:1ff4cb7e9ff06cda8dc2ce90cb8d2df79000651f7a9aa92adabf7b90b15e2023], size=974787418, virtualSize=974787418, sharedSize=-1, labels={org.opencontainers.image.ref.name=ubuntu, org.opencontainers.image.version=22.04}, containers=-1), Image(created=1682027207, id=sha256:fbb6f704a98f54bd28e1d4b2580fefafa5824014ea74566533e86b3ba3a0c927, parentId=, repoTags=[public.ecr.aws/sam/build-python3.10:latest-arm64], repoDigests=[public.ecr.aws/sam/build-python3.10@sha256:93a18ce598de4d55922664eebd1823696e0adc8610463e3c973aaf1ad4cb379d], size=1844103422, virtualSize=1844103422, sharedSize=-1, labels=null, containers=-1), Image(created=1681767009, id=sha256:cc4f9319e2a17ab9b3ec3694c4a4ee0f103520ff9cec06ef5d3a7217ea4b4d9a, parentId=, repoTags=[public.ecr.aws/lambda/java:17], repoDigests=[public.ecr.aws/lambda/java@sha256:cb31dfadf65a9bfd86363af4874345fd1ee2b1d942d74590a670237ace654890], size=529699419, virtualSize=529699419, sharedSize=-1, labels=null, containers=-1), Image(created=1681411010, id=sha256:9280a10caf40b31effb3fd770e9eeef6ef656dd7ccd7b8bb93005a589dc55369, parentId=, repoTags=[public.ecr.aws/docker/library/node:18], repoDigests=[public.ecr.aws/docker/library/node@sha256:671ee8d49ce2a691fc3082203c5deb9522e0c80042aa0ff40c07f4a25e63668a], size=947168455, virtualSize=947168455, sharedSize=-1, labels=null, containers=-1), Image(created=1681325025, id=sha256:fa632aaf1dcc5e236f15ba922b127fb02c85910bbb7e04dcb52bbeaddb0aeab8, parentId=, repoTags=[amazon/aws-cli:latest], repoDigests=[amazon/aws-cli@sha256:2a787834535e0e7fb1c558d88da92d66727126c9d8dacd131a73dd4a1d939f4d], size=404298680, virtualSize=404298680, sharedSize=-1, labels=null, containers=-1), Image(created=1681261693, id=sha256:10eca6bd49fbc1f2fd7a67674350d3dababe7fc9a71bad4909463d48cfb9b4b3, parentId=, repoTags=[public.ecr.aws/docker/library/python:3.9], repoDigests=[public.ecr.aws/docker/library/python@sha256:2d8875d28ca023a9056a828518adcdd634ba03740e1e3b197c06eb4527c6152c], size=858262709, virtualSize=858262709, sharedSize=-1, labels=null, containers=-1), Image(created=1680897327, id=sha256:ac9c23c959d0c88aa5c948a020244c91f7d128d73514265c78876767bdbe5df1, parentId=, repoTags=[cypress/browsers:latest], repoDigests=[cypress/browsers@sha256:06f2abc92eb45780a026616928db5a6f4fe7aba82c9d732f8e140fd37efb3913], size=600745011, virtualSize=600745011, sharedSize=-1, labels=null, containers=-1), Image(created=1679966420, id=sha256:45ca3dd3a1887736bb5f367c0d7e3ed07aceea2bf05ea14ab9a19d087f36500f, parentId=, repoTags=[postgres:15.2], repoDigests=[postgres@sha256:5a90725b3751c2c7ac311c9384dfc1a8f6e41823e341fb1dceed96a11677303a], size=359633981, virtualSize=359633981, sharedSize=-1, labels=null, containers=-1), Image(created=1678438672, id=sha256:3ee38b42dfd42efcccbf3cdc218af442524c9e751eaae6576693b958417d6159, parentId=, repoTags=[testcontainers/ryuk:0.4.0], repoDigests=[testcontainers/ryuk@sha256:b874cc015594f275ad3ffb6a135c015c52ce04a2eba377c963abe25a84628167], size=12170715, virtualSize=12170715, sharedSize=-1, labels={org.testcontainers.ryuk=true}, containers=-1), Image(created=1678249961, id=sha256:bab8ce5c00ca3ef91e0d3eb4c6e6d6ec7cffa9574c447fd8d54a8d96e7c1c80e, parentId=, repoTags=[ubuntu:22.04], repoDigests=[ubuntu@sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21], size=69212233, virtualSize=69212233, sharedSize=-1, labels={org.opencontainers.image.ref.name=ubuntu, org.opencontainers.image.version=22.04}, containers=-1), Image(created=1676064248, id=sha256:d74e625d91152966d38fe8a62c60daadb96d4b94c1a366de01fab5f334806239, parentId=, repoTags=[alpine:latest], repoDigests=[alpine@sha256:c8deccde20bcc319a17c28ce674b80b9b7e945a8b460a11272b7f0a3e0d6a746], size=7458929, virtualSize=7458929, sharedSize=-1, labels=null, containers=-1), Image(created=1675968181, id=sha256:6117ffa1251994551b54ab9d831cb5144e160896eb696c086ce71bd1a47dcbcd, parentId=, repoTags=[public.ecr.aws/sam/build-python3.9:latest-x86_64], repoDigests=[public.ecr.aws/sam/build-python3.9@sha256:10bc9fc4c4f8d21a9d928582cfc2ef609b35e903575587b25bead2c398ec6f7a], size=1584277128, virtualSize=1584277128, sharedSize=-1, labels=null, containers=-1), Image(created=1673444869, id=sha256:a5d4fe06f73079c4a4d0379f2bf47a21bca37786e4382eea7d7a05638c2cd613, parentId=, repoTags=[postgres:14.6], repoDigests=[postgres@sha256:35cfaf49cde39e1b03afb1a0a821787ef8e3955c36bdc447735b5f1c4179a23b], size=357236314, virtualSize=357236314, sharedSize=-1, labels=null, containers=-1), Image(created=1672942120, id=sha256:fd852dc8cbb384f968d90136cc33884cb0f5c5a5bb9fc0df462606a7a9e62fa6, parentId=, repoTags=[stripe/stripe-mock:latest], repoDigests=[stripe/stripe-mock@sha256:12ba17b08e7d1bf8246685fe6a774a7e659d2c150467463a1fdaf5265e2b9b0e], size=18386809, virtualSize=18386809, sharedSize=-1, labels=null, containers=-1), Image(created=1671032810, id=sha256:2deccb447f834b51219fdc50cd0e41cdf282679c51c41b92e777f73f813ba951, parentId=, repoTags=[stripe/stripe-mock:v0.148.0], repoDigests=[stripe/stripe-mock@sha256:2a8ba4cb649291fe5f045b5956bc3187386f009d4777ff4cf1f0a0bf10e1198f], size=18386809, virtualSize=18386809, sharedSize=-1, labels=null, containers=-1), Image(created=1670894964, id=sha256:01969ba350aba50fe546bfdabce607d6386440536b0f2e204b354101dddbe561, parentId=, repoTags=[ecs-deploy:3.10.7, ecs-deploy:latest, public.ecr.aws/o6r2q6p9/ecs-deploy:3.10.7, public.ecr.aws/o6r2q6p9/ecs-deploy:latest], repoDigests=[public.ecr.aws/o6r2q6p9/ecs-deploy@sha256:597e93e8815cf39f4314ec17242d2dd6898843e1d0c50b6f9b09eee46ef9116f], size=178256362, virtualSize=178256362, sharedSize=-1, labels=null, containers=-1), Image(created=1668119336, id=sha256:c8a1687b5c7c2c84d683d520aeb6be7c18d9173296ca582ef3061aae1450f37d, parentId=, repoTags=[stripe/stripe-mock:v0.145.0], repoDigests=[stripe/stripe-mock@sha256:7a3cbdceb18cd62f5245bc90475e1ed38017ad8ae53a6d8adff14c95b1b2c29a], size=17056884, virtualSize=17056884, sharedSize=-1, labels=null, containers=-1), Image(created=1666907850, id=sha256:6fe4199a674c52d9ea08f9117a4a58daab38250d8e9670926efa6f7079820662, parentId=, repoTags=[public.ecr.aws/sam/build-python3.9:latest-arm64], repoDigests=[public.ecr.aws/sam/build-python3.9@sha256:030d50659e1198e3bb9ce45c92a4e3e2976ac1ba7d31d8828d0ee1a49d060f8a], size=2239986549, virtualSize=2239986549, sharedSize=-1, labels=null, containers=-1), Image(created=1666728433, id=sha256:3c326264b59963877dedf2671d5da3c3f047b91f35c70fad777fd7c8e0a4c99d, parentId=, repoTags=[postgres:14.5], repoDigests=[postgres@sha256:135c62a8134dcef829a1e4f5568bfae44bcfa2c75659ff948f43c71964366aa4], size=357182500, virtualSize=357182500, sharedSize=-1, labels=null, containers=-1), Image(created=1666121219, id=sha256:71ac63309b0fb01d5627948c8a1d9c8fd2534f6630583b81ad13ae717d46c251, parentId=, repoTags=[moby/buildkit:buildx-stable-1], repoDigests=[moby/buildkit@sha256:46e7907bf9cdced1af7e45f1f07f69cb30560574d85d636a17ce6f97cc4844b4], size=133559945, virtualSize=133559945, sharedSize=-1, labels=null, containers=-1), Image(created=1659438728, id=sha256:fb7289787adeed3b8c7ff81d4014355b5efca528eed086768cdeeae550dae8bf, parentId=, repoTags=[postgres:14.4], repoDigests=[postgres@sha256:9ceb24f8c5f15c053d973a3610866f473690875dc13eb3282b45302189321040], size=355415783, virtualSize=355415783, sharedSize=-1, labels=null, containers=-1), Image(created=1659017550, id=sha256:5d28cedc492d64d21c11814d84d9d41566f07023b9c95245e163b05acfcb7172, parentId=, repoTags=[testcontainers/ryuk:0.3.4], repoDigests=[testcontainers/ryuk@sha256:0c8faa0a3ad1e154f9d8d5d78627b40d7359ff3f7d3f98556aa32157ad8fd924], size=11483382, virtualSize=11483382, sharedSize=-1, labels=null, containers=-1), Image(created=1653720508, id=sha256:12b9b2057476daa75bdb842f7b52629b7c523c0a5100cbbaf50533f8f0d1496e, parentId=, repoTags=[postgres:14.3], repoDigests=[postgres@sha256:2d1e636f07781d4799b3f2edbff78a0a5494f24c4512cb56a83ebfd0e04ec074], size=355431036, virtualSize=355431036, sharedSize=-1, labels=null, containers=-1), Image(created=1643389640, id=sha256:40aa64bceb188131df7028d3fc7696d105ea9665e56bcce39361b341422f5074, parentId=, repoTags=[mlupin/docker-lambda:python3.9-build], repoDigests=[mlupin/docker-lambda@sha256:94f18ce217908f2733cd6ad1dba8034071dbfdc144a08f3d83d6856d716ec07e], size=2028296754, virtualSize=2028296754, sharedSize=-1, labels=null, containers=-1)]
2023-05-30 19:20:13  DEBUG AbstractImagePullPolicy - Using locally available and not pulling image: testcontainers/ryuk:0.5.1
2023-05-30 19:20:13  INFO  1 - Creating container for image: testcontainers/ryuk:0.5.1
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - Looking up auth config for image: testcontainers/ryuk:0.5.1 at registry: https://index.docker.io/v1/
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - RegistryAuthLocator has configFile: /Users/andrei/.docker/config.json (exists) configEnv: DOCKER_AUTH_CONFIG (does not exist) and commandPathPrefix: 
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - RegistryAuthLocator reading from configFile: /Users/andrei/.docker/config.json
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - registryName [https://index.docker.io/v1/] for dockerImageName [testcontainers/ryuk:0.5.1]
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - Executing docker credential provider: docker-credential-desktop to locate auth config for: https://index.docker.io/v1/
2023-05-30 19:20:13  DEBUG ProcessExecutor - Executing [docker-credential-desktop, get].
2023-05-30 19:20:13  DEBUG ProcessExecutor - Started Process[pid=41387, exitValue="not exited"]
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@49f8fa93 started.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@7b71fc8d started.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@7b71fc8d finished.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@49f8fa93 finished.
2023-05-30 19:20:13  DEBUG WaitForProcess - Process[pid=41387, exitValue=1] stopped with exit code 1
2023-05-30 19:20:13  TRACE PumpStreamHandler - Joining input thread Thread[Thread-0,5,]...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Joining output thread Thread[Thread-1,5,]...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Flushing output stream credentials not found in native keychain
...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Flushing error stream org.testcontainers.shaded.org.zeroturnaround.exec.stream.NullOutputStream@6ecd44b1...
2023-05-30 19:20:13  DEBUG ProcessExecutor - Executing [docker-credential-desktop, get].
2023-05-30 19:20:13  DEBUG ProcessExecutor - Started Process[pid=41394, exitValue="not exited"]
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@5ab7ad34 started.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@6f129746 started.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@6f129746 finished.
2023-05-30 19:20:13  TRACE StreamPumper - org.testcontainers.shaded.org.zeroturnaround.exec.stream.StreamPumper@5ab7ad34 finished.
2023-05-30 19:20:13  DEBUG WaitForProcess - Process[pid=41394, exitValue=1] stopped with exit code 1
2023-05-30 19:20:13  TRACE PumpStreamHandler - Joining input thread Thread[Thread-2,5,]...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Joining output thread Thread[Thread-3,5,]...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Flushing output stream credentials not found in native keychain
...
2023-05-30 19:20:13  TRACE PumpStreamHandler - Flushing error stream org.testcontainers.shaded.org.zeroturnaround.exec.stream.NullOutputStream@6ecd44b1...
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - Got credentials not found error message from docker credential helper - credentials not found in native keychain
2023-05-30 19:20:13  INFO  RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for https://index.docker.io/v1/
2023-05-30 19:20:13  DEBUG RegistryAuthLocator - No matching Auth Configs - falling back to defaultAuthConfig [null]
2023-05-30 19:20:13  DEBUG AuthDelegatingDockerClientConfig - Effective auth config [null]
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl@7c281eb8[aliases=<null>,argsEscaped=<null>,attachStderr=<null>,attachStdin=<null>,attachStdout=<null>,authConfig=<null>,cmd={},domainName=<null>,entrypoint=<null>,env={},exposedPorts=ExposedPorts(exposedPorts=[8080/tcp]),healthcheck=<null>,hostConfig=HostConfig(binds=[/Users/andrei/.docker/run/docker.sock:/var/run/docker.sock:rw], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=[], groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=true, oomScoreAdj=null, portBindings={8080/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@5792c08c}, privileged=false, publishAllPorts=null, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=[], mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null, cgroupnsMode=null),hostName=<null>,image=testcontainers/ryuk:0.5.1,ipv4Address=<null>,ipv6Address=<null>,labels={org.testcontainers=true, org.testcontainers.lang=java, org.testcontainers.version=1.18.2},macAddress=<null>,name=testcontainers-ryuk-977adad8-403b-479d-ac04-ccf9737ce6af,networkDisabled=<null>,networkingConfig=<null>,onBuild=<null>,platform=<null>,portSpecs=<null>,shell=<null>,stdInOnce=<null>,stdinOpen=<null>,stopSignal=<null>,stopTimeout=<null>,tty=<null>,user=<null>,volumes=Volumes(volumes=[]),workingDir=<null>]
2023-05-30 19:20:13  TRACE CreateContainerCmdExec - POST: DefaultWebTarget{path=[/containers/create], queryParams={name=[testcontainers-ryuk-977adad8-403b-479d-ac04-ccf9737ce6af]}} 
2023-05-30 19:20:13  INFO  1 - Container testcontainers/ryuk:0.5.1 is starting: f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2
2023-05-30 19:20:13  TRACE StartContainerCmdExec - POST: DefaultWebTarget{path=[/containers/f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2/start], queryParams={}}
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2,false
2023-05-30 19:20:13  DEBUG InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2/json], queryParams={}}
2023-05-30 19:20:13  DEBUG AbstrDockerCmd - Cmd: f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2,false
2023-05-30 19:20:13  DEBUG InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/f4e6960c9bf59c1f315717553ddd14f7f5db005dcb38a025d41e6a32a024bcd2/json], queryParams={}}
2023-05-30 19:20:13  ERROR 1 - Could not start container
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: ........

@gtrefs
Copy link

gtrefs commented May 31, 2023

I do have the same issue:

11:25:24.120 [main] WARN  org.testcontainers.utility.TestcontainersConfiguration - Attempted to read Testcontainers configuration file at file:/Users/gtrefs/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /Users/gtrefs/.testcontainers.properties (No such file or directory)
11:25:24.123 [main] INFO  org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
11:25:24.774 [main] INFO  org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Testcontainers Host with tc.host=unix:///Users/gtrefs/.docker/run/docker.sock
11:25:24.775 [main] INFO  org.testcontainers.DockerClientFactory - Docker host IP address is localhost
11:25:24.795 [main] INFO  org.testcontainers.DockerClientFactory - Connected to docker: 
  Server Version: 23.0.5
  API Version: 1.42
  Operating System: Docker Desktop
  Total Memory: 7851 MB
11:25:24.818 [main] INFO  tc.testcontainers/ryuk:0.5.1 - Creating container for image: testcontainers/ryuk:0.5.1
11:25:25.253 [main] INFO  org.testcontainers.utility.RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for https://index.docker.io/v1/
11:25:25.336 [main] INFO  tc.testcontainers/ryuk:0.5.1 - Container testcontainers/ryuk:0.5.1 is starting: 7943785363a7ad38458db5764255644539407d231f76b05d740014d43a9e6718
11:25:25.653 [main] ERROR tc.testcontainers/ryuk:0.5.1 - Could not start container
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: 7943785363a7ad38458db5764255644539407d231f76b05d740014d43a9e6718"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:31) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:13) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.github.dockerjava.core.command.InspectContainerCmdImpl.exec(InspectContainerCmdImpl.java:52) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.lambda$tryStart$1(GenericContainer.java:456) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.lambda$new$0(AbstractHamcrestCondition.java:48) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235) ~[testcontainers-1.18.2.jar:1.18.2]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at org.testcontainers.shaded.org.awaitility.core.SameThreadExecutorService.execute(SameThreadExecutorService.java:79) ~[testcontainers-1.18.2.jar:1.18.2]
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) ~[?:?]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:101) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.AbstractHamcrestCondition.await(AbstractHamcrestCondition.java:86) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:691) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.org.awaitility.core.ConditionFactory.until(ConditionFactory.java:708) ~[testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:455) ~[testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344) ~[testcontainers-1.18.2.jar:?]
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81) [duct-tape-1.0.8.jar:?]
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334) [testcontainers-1.18.2.jar:?]
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322) [testcontainers-1.18.2.jar:?]
	at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:95) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:40) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:19) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:41) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.shaded.com.google.common.util.concurrent.Futures$3.get(Futures.java:1332) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.images.RemoteDockerImage.getImageName(RemoteDockerImage.java:126) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:67) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:28) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:19) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:41) [testcontainers-1.18.2.jar:1.18.2]
	at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1406) [testcontainers-1.18.2.jar:?]
	at com.liveperson.containers.CassandraContainer.<init>(CassandraContainer.java:37) [test-classes/:?]
	at com.liveperson.IntegrationTest.<clinit>(IntegrationTest.java:60) [test-classes/:?]
	at jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method) ~[?:?]
	at jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042) [?:?]
	at jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) [?:?]
	at jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:186) [?:?]
	at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1105) [?:?]
	at java.lang.reflect.Field.getFieldAccessor(Field.java:1086) [?:?]
	at java.lang.reflect.Field.get(Field.java:418) [?:?]
	at org.junit.runners.model.FrameworkField.get(FrameworkField.java:92) [junit-4.13.2.jar:4.13.2]
	at org.junit.runners.model.TestClass.collectAnnotatedFieldValues(TestClass.java:249) [junit-4.13.2.jar:4.13.2]
	at org.junit.runners.ParentRunner.classRules(ParentRunner.java:280) [junit-4.13.2.jar:4.13.2]
	at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:268) [junit-4.13.2.jar:4.13.2]
	at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:217) [junit-4.13.2.jar:4.13.2]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:412) [junit-4.13.2.jar:4.13.2]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) [spring-test-5.3.19.jar:5.3.19]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.13.2.jar:4.13.2]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) [junit-rt.jar:?]
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) [junit-rt.jar:?]
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) [idea_rt.jar:?]
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) [junit-rt.jar:?]
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) [junit-rt.jar:?]
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) [junit-rt.jar:?]
11:25:25.675 [main] ERROR tc.testcontainers/ryuk:0.5.1 - There are no stdout/stderr logs available for the failed container

@gtrefs
Copy link

gtrefs commented May 31, 2023

I am running Docker Desktop version 4.19.0 (106363) and testcontainers 1.18.2. I enabled Enable default Docker socket in the Advanced options of Docker Desktop. This will create the socket at /var/run/docker.sock. When I run, docker run -d -v /var/run/docker.sock:/var/run/docker.sock -e RYUK_PORT=8080 -p 8080:8080 docker.io/testcontainers/ryuk:0.5.1 ryuk is started properly.

@eddumelendez
Copy link
Member

Can you please share docker context ls output?

@eddumelendez
Copy link
Member

Thanks @gtrefs. I'm not sure how to reproduce this, for me is working as expected :/ See #7082 (comment)

@gtrefs
Copy link

gtrefs commented May 31, 2023

NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                KUBERNETES ENDPOINT   ORCHESTRATOR
default             moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock
desktop-linux *     moby                                                          unix:///Users/gtrefs/.docker/run/docker.sock

@gtrefs
Copy link

gtrefs commented May 31, 2023

oh... I had colima installed before and it seems like it was still set to desktop-linux. After I run docker context use default it works again.

Edit: I removed the desktop-linux context: docker context rm desktop-linux Thanks @eddumelendez for the help.

@eddumelendez
Copy link
Member

eddumelendez commented May 31, 2023

Now, I'm able to reproduce and see the reason. Thank you so much for reporting this issue!

gtcno added a commit to navikt/dp-rapportering-viggo that referenced this issue May 31, 2023
eddumelendez added a commit that referenced this issue May 31, 2023
* Improve DockerDesktopClientProviderStrategy description
* Fix TestcontainersHostPropertyClientProviderStrategy only when tc.host is present

Fixes #7082
@eddumelendez eddumelendez pinned this issue May 31, 2023
@DRoppelt
Copy link

DRoppelt commented May 31, 2023

Cool stuff seeing this regression being tackled so quickly!

We are seeing a similar error from 1.18.1 -> 1.18.2, with Kafka containers and on a linux host, as a rootless docker host. From what I am seeing this seems to be addressed just the same with the commits. (if not, let me know what I could possible provide to verify)

Any idea when a 1.18.3 could hit public repos? Not urgent, just curious. cool, released 3h ago :)

@eddumelendez
Copy link
Member

Testcontainers for Java 1.18.3 is out https://repo1.maven.org/maven2/org/testcontainers/testcontainers/1.18.3/testcontainers-1.18.3.pom

Thank you so much for testing it so quickly and raising the issue again!

@kamal-github
Copy link

I am still getting the same error, upgrading to 1.18.3 did not fix this issue.

I am using
Mac M1.
podman version 4.5.1

~/.testcontainers.properties
docker.client.strategy=org.testcontainers.dockerclient.UnixSocketClientProviderStrategy

Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.5.1
at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:349)
at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
at app//org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
at app//org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
at app//org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)
at app//org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
at app//com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)

@momo-saeedi
Copy link

momo-saeedi commented Jul 3, 2023

I am getting the same error on mac m1/colima docker

14:57:24.760 [Test worker] ERROR tc.testcontainers/ryuk:0.5.1 - There are no stdout/stderr logs available for the failed container

Container startup failed for image testcontainers/ryuk:0.5.1
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/ryuk:0.5.1
	at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:349)
	at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
	at app//org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
	at app//org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
	at app//org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)
	at app//org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:104)
	at app//com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
	at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)

@bradnussbaum
Copy link

bradnussbaum commented Jul 4, 2023

Getting error on 1.18.3 on linux. The image is actually being pulled though as it shows up in docker images output.

04-Jul-2023 04:12:46 | 2023-07-04 11:12:46,062 [main]                         ERROR tc.testcontainers/ryuk:0.5.1         - Failed to pull image: testcontainers/ryuk:0.5.1. Please check output of `docker pull testcontainers/ryuk:0.5.1`
-- | --
04-Jul-2023 04:12:46 | java.lang.InterruptedException: null
04-Jul-2023 04:12:46 | at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:998)
04-Jul-2023 04:12:46 | at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
04-Jul-2023 04:12:46 | at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
04-Jul-2023 04:12:46 | at com.github.dockerjava.api.async.ResultCallbackTemplate.awaitCompletion(ResultCallbackTemplate.java:91)
04-Jul-2023 04:12:46 | at org.testcontainers.images.TimeLimitedLoggedPullImageResultCallback.awaitCompletion(TimeLimitedLoggedPullImageResultCallback.java:58)
04-Jul-2023 04:12:46 | at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:90)
04-Jul-2023 04:12:46 | at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:28)
04-Jul-2023 04:12:46 | at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:19)
04-Jul-2023 04:12:46 | at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:41)
04-Jul-2023 04:12:46 | at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1406)
04-Jul-2023 04:12:46 | at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:662)
04-Jul-2023 04:12:46 | at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:331)
04-Jul-2023 04:12:46 | at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
04-Jul-2023 04:12:46 | at org.testcontainers.utility.RyukResourceReaper.maybeStart(RyukResourceReaper.java:78)
04-Jul-2023 04:12:46 | at org.testcontainers.utility.RyukResourceReaper.init(RyukResourceReaper.java:42)
04-Jul-2023 04:12:46 | at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:229)

@dbubenheim
Copy link

dbubenheim commented Jul 7, 2023

I had a similar issue and adding the following line to the .testcontainers.properties file solved it for me

~/.testcontainers.properties

ryuk.container.privileged=true

@monosoul
Copy link
Contributor

monosoul commented Jul 17, 2023

I just had to troubleshoot the same issue with a colleague who has an M1 Mac and testcontainers 1.18.3, unfortunately I can't provide much details as we didn't get to debug through it, but 2 things that helped with it:

  1. reverting to testcontainers 1.18.1;
  2. setting tc.host=127.0.0.1 like this comment suggested here.

@eddumelendez would you mind reopening the issue as it doesn't seem to be fixed at the moment?

@eddumelendez
Copy link
Member

Can you please upgrade to 1.18.3?

@monosoul
Copy link
Contributor

It was happening on 1.18.3

@eddumelendez
Copy link
Member

@monosoul tc.host=127.0.0.1 doesn't exist in 1.18.1 and it shouldn't be needed in 1.18.3

@monosoul
Copy link
Contributor

@eddumelendez yeah, what I meant is that downgrading to 1.18.1 has definitely worked, but setting tc.host=127.0.0.1 with 1.18.3 also worked. I'll reach out to the colleague to double check the latter, we might have missed something there. Will let you know once I have more info.

@monosoul
Copy link
Contributor

Okay, this is weird. The colleague has now removed tc.host=127.0.0.1 from the properties file and it still works for them, even after reboot. Previously, we couldn't make it work with 1.18.3 no matter how many times they reboot the laptop, and no matter what configuration we provided via these properties.
So we can't reproduce the issue now.
If it was Linux with SELinux enabled, I would assume that was some kind of a labeling issue that prevented testcontainers from accessing the socket. I'm not very familiar with Mac OS and not sure if it has any systems like that, but maybe something like that was the root cause there.
Sorry I can't provide more info here to help debug it 🤷

@electricsam
Copy link

I had the same issue on my M1 Mac and resolved it from these instructions here: https://vividcode.io/colima-apple-m-1-and-testcontainers/

I set the following environment variables:

DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
TESTCONTAINERS_RYUK_DISABLED=true

@JonasGroeger
Copy link

JonasGroeger commented Aug 22, 2023

I had a similar problem and solved it by just cleaning my docker install:

$ sudo apt remove docker-ce
$ sudo mv /var/lib/docker /var/lib/docker.bak
$ sudo apt install docker-ce

# If everything works, delete the old containers / images / logs / networks / etc.
sudo rm -rf /var/lib/docker.bak

@kohpai
Copy link

kohpai commented Sep 4, 2023

I had a similar issue and adding the following line to the .testcontainers.properties file solved it for me

~/.testcontainers.properties

ryuk.container.privileged=true

I can confirm that this works for me on Mac M2, Podman. But now I'm wondering, why does testcontainers need privileged?

@bldev2473
Copy link

bldev2473 commented Sep 18, 2023

I had a similar issue and adding the following line to the .testcontainers.properties file solved it for me

~/.testcontainers.properties


ryuk.container.privileged=true

Problem solved in Intel Mac and Ventura.
I'm using podman and testcontainer 1.18.0

@YulianaPoliakova
Copy link

Same issue on Mac M1 arm64 and testcontainers 1.19.1, adding privileged=true to properties didn't help

@AnastasiiaRev
Copy link

testcontainers dependency 1.19.6 and docker image testcontainers/ryuk:0.3.1 specified in testcontainers.properties are working for me

@neseleznev
Copy link

neseleznev commented Mar 7, 2024

I got the same on 1.18.2, 1.18.3, and 1.19.7.
I tried deleting ~/.testcontainers.properties, but it is recreated with the same (default?) settings:

cat ~/.testcontainers.properties

#Modified by Testcontainers
#Thu Mar 07 15:22:17 CET 2024
docker.client.strategy=org.testcontainers.dockerclient.UnixSocketClientProviderStrategy
testcontainers.reuse.enable=false

The error is:

Caused by: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"error while creating mount source path '/host_mnt/Users/nikita/.docker/run/docker.sock': mkdir /host_mnt/Users/nikita/.docker/run/docker.sock: operation not supported"

latest macOS, arm64 (M1)

@intigam-farajli
Copy link

Getting same error for testcontainers/sshd:1.1.0

tectcontainers version 1.19.5, MacOs M1 Pro, Sonoma 14.3.1

` Caused by:
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image testcontainers/sshd:1.1.0
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:362)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:333)
at org.testcontainers.containers.PortForwardingContainer.createSSHSession(PortForwardingContainer.java:52)
at org.testcontainers.containers.PortForwardingContainer.getSshConnection(PortForwardingContainer.java:47)
at org.testcontainers.containers.PortForwardingContainer.exposeHostPort(PortForwardingContainer.java:78)
at org.testcontainers.containers.PortForwardingContainer.exposeHostPort(PortForwardingContainer.java:72)
at org.testcontainers.Testcontainers.exposeHostPorts(Testcontainers.java:14)
at com.refinitiv.itop.it.TestContainersConfig.(TestContainersConfig.java:47)
... 78 more

        Caused by:
        org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
            at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
            at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:347)
            ... 85 more

            Caused by:
            org.testcontainers.containers.ContainerLaunchException: Could not create/start container
                at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:566)
                at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:357)
                at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
                ... 86 more

                Caused by:
                org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (172.17.0.1 ports: [59640] should be listening)
                    at org.testcontainers.containers.wait.strategy.HostPortWaitStrategy.waitUntilReady(HostPortWaitStrategy.java:112)
                    at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
                    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:912)
                    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:503)
                    ... 88 more`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests