Skip to content

[Bug]: Docker engine 29 (docker 4.52) is no longer compatible v1.21 #11235

Closed as duplicate

Description

@benoitgravitee

Module

Core

Testcontainers version

1.21.3

Using the latest Testcontainers version?

No

Host OS

MacOs 15.6.1

Host Arch

ARM

Docker version

Client: Docker Engine - Community
 Version:           27.2.1
 API version:       1.47
 Go version:        go1.23.1
 Git commit:        9e34c9bb39
 Built:             Fri Sep  6 12:01:30 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.52.0 (210994)
 Engine:
  Version:          29.0.1
  API version:      1.52 (minimum version 1.44)
  Go version:       go1.25.4
  Git commit:       198b5e3
  Built:            Fri Nov 14 16:18:20 2025
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v2.1.5
  GitCommit:        fcd43222d6b07379a4be9786bda52438f0dd16a1
 runc:
  Version:          1.3.3
  GitCommit:        v1.3.3-0-gd842d771
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

Tried to start a container, got 400 HTTP error communicating with Docker engine preventing the container from starting.

Switching to test-containers 2.0.2 fixed the issue, but cannot upgrade the whole project.

Relevant log output

Caused by: com.github.dockerjava.api.exception.BadRequestException: Status 400: {"message":"client version 1.32 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version"}

        at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:237)
        at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:124)
        at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:37)
        at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.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:33)
        at org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:608)
        at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:430)

Additional Information

No response

Activity

  1. jobayle commented on Nov 21, 2025

    @jobayle

    Ok I've spent the morning trying to figure out what's wrong with my setup, but it was a protocol update in the new docker version.
    Your error message is way more explicit than mine, see:

    Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    	NpipeSocketClientProviderStrategy: failed with exception BadRequestException (Status 400: {"ID":"","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"","DriverStatus":null,"Plugins":{"Volume":null,"Network":null,"Authorization":null,"Log":null},"MemoryLimit":false,"SwapLimit":false,"CpuCfsPeriod":false,"CpuCfsQuota":false,"CPUShares":false,"CPUSet":false,"PidsLimit":false,"IPv4Forwarding":false,"Debug":false,"NFd":0,"OomKillDisable":false,"NGoroutines":0,"SystemTime":"","LoggingDriver":"","CgroupDriver":"","NEventsListener":0,"KernelVersion":"","OperatingSystem":"","OSVersion":"","OSType":"","Architecture":"","IndexServerAddress":"","RegistryConfig":null,"NCPU":0,"MemTotal":0,"GenericResources":null,"DockerRootDir":"","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"","Labels":["com.docker.desktop.address=npipe://\\\\.\\pipe\\docker_cli"],"ExperimentalBuild":false,"ServerVersion":"","Runtimes":null,"DefaultRuntime":"","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"","ContainerdCommit":{"ID":""},"RuncCommit":{"ID":""},"InitCommit":{"ID":""},"SecurityOptions":null,"CDISpecDirs":null,"Warnings":null})As no valid configuration was found, execution cannot continue.
    See https://java.testcontainers.org/on_failure.html for more details.
    

    Switching to tc-java 2.0.2 works, with tc-postgres at 1.21.3

  2. llencucha-bitso commented on Nov 21, 2025

    @llencucha-bitso

    Hey there,

    this is how to fix the minimum API version requirement (which is 1.32 by default, but latest docker requires 1.44):

    1. create .docker-java.properties in your home folder
    2. insert the following text in the file: api.version=1.44
    3. Save the file
    4. Profit
  3. dragetd commented on Nov 21, 2025

    @dragetd

    I can confirm this broke our testcontainers setup as well. The sad thing is, that the errors are not logged in the normal case, leaving me down a long route of debugging before finding this out.

    I was using the GitLab Service Feature with the image:

    The gradle error log was just:

    DigiCuraApplicationTests > contextLoads() FAILED
        java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180
            Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:804
                Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:804
                    Caused by: org.springframework.beans.factory.BeanCreationException at BeanDefinitionValueResolver.java:377
                        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:804
                            Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1826
                                Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException at HikariPool.java:610
                                    Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:274
    

    Only after enabling debug in gradle, I got the whole error:

    2025-11-21T13:32:05.140+0000 [DEBUG] [TestEventLogger]     2025-11-21 13:32:05 ERROR [ Test worker] o.t.d.DockerClientProviderStrategy  : Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    2025-11-21T13:32:05.140+0000 [DEBUG] [TestEventLogger]     	EnvironmentAndSystemPropertyClientProviderStrategy: failed with exception BadRequestException (Status 400: {"message":"client version 1.32 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version"}
    

    Using Testcontainer 1.21.

    The 'docker:did' Image I use in the CI was probably the culprit, since it is a mutable tag. I'll upgrade to testcontaienrs 2.x and see if this helps.

    EDIT: IT was not my docker:dind image, and I am not really sure how this happened to be honest...

    EDIT2: Yes, it WAS docker:dind that caused this issue... I just had another issue in parallel, that made debugging hard. Anyways, after using docker:28-dind in my CI, the error above was solved, without updating testcontainers.

  4. jobayle commented on Nov 21, 2025

    @jobayle

    @llencucha-bitso wrote:

    Hey there,

    this is how to fix the minimum API version requirement (which is 1.32 by default, but latest docker requires 1.44):

    1. create .docker-java.properties in your home folder
    2. insert the following text in the file: api.version=1.44
    3. Save the file
    4. Profit

    What does it do? is it something read by tc-java to make it use the proper API?

  5. llencucha-bitso commented on Nov 21, 2025

    @llencucha-bitso

    @jobayle

    What does it do? is it something read by tc-java to make it use the proper API?

    Yes. By default, if no version is set, testcontainers picks 1.32, which is not supported by Docker desktop anymore. Minimum version is 1.44, current version is 1.52

  6. seregamorph commented on Nov 24, 2025

    @seregamorph

    Hint: as a fast fix, you can download older Docker Desktop 4.51.0 from https://docs.docker.com/desktop/release-notes/#4510

  7. eddumelendez commented on Nov 24, 2025

    @eddumelendez
    Member

    workarounds has been shared in the previous issue. See #11212

  8. aistomin commented on Nov 24, 2025

    @aistomin

    workarounds has been shared in the previous issue. See #11212

    Why did you close the issue? Was the problem solved? You close it as a duplicate and reference "workarounds". According to Cambridge dictionary workaround is:

    a way of dealing with a problem or making something work despite the problem, without completely solving it

    The problem with software is still not solved, or is it?

  9. added a commit that references this issue on Mar 2, 2026
  10. 1812Vedant commented on Mar 28, 2026

    @1812Vedant

    Ok I've spent the morning trying to figure out what's wrong with my setup, but it was a protocol update in the new docker version. Your error message is way more explicit than mine, see:

    Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
    	NpipeSocketClientProviderStrategy: failed with exception BadRequestException (Status 400: {"ID":"","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"","DriverStatus":null,"Plugins":{"Volume":null,"Network":null,"Authorization":null,"Log":null},"MemoryLimit":false,"SwapLimit":false,"CpuCfsPeriod":false,"CpuCfsQuota":false,"CPUShares":false,"CPUSet":false,"PidsLimit":false,"IPv4Forwarding":false,"Debug":false,"NFd":0,"OomKillDisable":false,"NGoroutines":0,"SystemTime":"","LoggingDriver":"","CgroupDriver":"","NEventsListener":0,"KernelVersion":"","OperatingSystem":"","OSVersion":"","OSType":"","Architecture":"","IndexServerAddress":"","RegistryConfig":null,"NCPU":0,"MemTotal":0,"GenericResources":null,"DockerRootDir":"","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"","Labels":["com.docker.desktop.address=npipe://\\\\.\\pipe\\docker_cli"],"ExperimentalBuild":false,"ServerVersion":"","Runtimes":null,"DefaultRuntime":"","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"","ContainerdCommit":{"ID":""},"RuncCommit":{"ID":""},"InitCommit":{"ID":""},"SecurityOptions":null,"CDISpecDirs":null,"Warnings":null})As no valid configuration was found, execution cannot continue.
    See https://java.testcontainers.org/on_failure.html for more details.
    

    Switching to tc-java 2.0.2 works, with tc-postgres at 1.21.3

    Yes this works for me thanks I lot I was trying to resolve issue from month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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