Skip to content

[Bug] Test Failing Due to Inability to Recognize Running Docker Daemon #1564

@hs094

Description

@hs094

Current behavior

I am encountering an issue where tests are failing because the Docker Daemon cannot be recognized. Below is the relevant log trace:

18:32:26.686 [pool-275-thread-15] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)
    DockerDesktopClientProviderStrategy: failed with exception NullPointerException (Cannot invoke "java.nio.file.Path.toString()" because the return value of "org.testcontainers.dockerclient.DockerDesktopClientProviderStrategy.getSocketPath()" is null)
As no valid configuration was found, execution cannot continue.
See https://java.testcontainers.org/on_failure.html for more details.
[error] Error starting Elasticsearch container: {java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration}
[error] Error starting PostgreSQL container: {java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration}

![Image](https://github.com/user-attachments/assets/9c37a10f-30a8-4163-8552-221c74580cf7)

The tests fail with errors indicating that a valid Docker environment could not be found.

Expected Behavior

The tests should recognize the Docker Daemon and start the required containers without errors.

Extra comments

Additional Information

  • Docker is installed and running on the system.
  • The Docker Daemon is accessible and other Docker commands work as expected.

Environment

  • Operating System: macOS
  • Docker Version: Docker version 28.0.0, build f9ced58158
  • Testcontainers Version:
  "org.testcontainers" % "postgresql" % "1.20.6",
  "org.testcontainers" % "elasticsearch" % "1.20.6",
  "org.tpolecat" %% "doobie-postgres" % "0.13.4"

Search terms

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions