Error response from daemon: client version 1.24 is too old. Minimum supported API version is 1.40, please upgrade your client to a newer version means the program talking to Docker asked for an API version older than the engine accepts. In the case reproduced here it was the Docker CLI with a DOCKER_API_VERSION variable pinned to an old value; clearing the variable fixed it.

The numbers in the message are the two sides of the conversation: 1.24 is what the client sent, 1.40 is the oldest the engine accepts. With the variable removed the client sent its own 1.56 and the command worked.

The error

PS> $env:DOCKER_API_VERSION='1.24'; docker ps
Error response from daemon: client version 1.24 is too old. Minimum supported API version is 1.40, please upgrade your client to a newer version

docker version with the same variable prints the client block, marks the version as downgraded, and then fails with a different, less helpful line:

PS> $env:DOCKER_API_VERSION='1.24'; docker version
Client:
 Version:           29.9.3
 API version:       1.24 (downgraded from 1.56)
...
Error response from daemon: API returned a 400 (Bad Request) but provided no error-message

Why it happens

The Docker CLI talks to the engine over a versioned HTTP API. Normally the 29.9.3 client uses API 1.56; with DOCKER_API_VERSION set, docker version showed 1.24 (downgraded from 1.56). The engine on this machine reported a minimum of 1.40, so it refused the 1.24 request and named both numbers in the reply.

A variable like this is easy to miss because nothing in the failing command mentions it. In the test it was set with $env:DOCKER_API_VERSION in the same PowerShell session, and the docker commands run there picked it up.

The fix

PS> Remove-Item Env:DOCKER_API_VERSION; docker ps --format "{{.Names}}" --filter name=fix10-dc-h1
fix10-dc-h1

PS> docker version --format "client {{.Client.Version}} api {{.Client.APIVersion}}, server {{.Server.Version}} api {{.Server.APIVersion}} min {{.Server.MinAPIVersion}}"
client 29.9.3 api 1.56, server 29.9.3 api 1.56 min 1.40

Remove-Item Env:DOCKER_API_VERSION clears the variable for the current PowerShell session. If it comes back in a new window, it is set in your user or system environment variables or a profile script; remove it there.

The last command above shows both numbers at once: the API your client sends and the minimum the engine accepts. Only the Docker CLI was tested here.

How it was reproduced

Docker Desktop on Windows with client and engine 29.9.3 (engine API 1.56, minimum 1.40), from Windows PowerShell 5.1. Setting $env:DOCKER_API_VERSION='1.24' for the session and running docker ps produced the message; clearing the variable fixed it. A value above the engine's version, 1.99, did not produce an error here: docker ps listed the containers normally. The container name in the output is the test's own.

Frequently asked

What does client version is too old mean in Docker?
The client asked the engine for an API version older than the engine supports. On Docker 29.9.3 the minimum was 1.40. In the test the cause was a DOCKER_API_VERSION variable set to 1.24, and clearing it fixed the error.
How do I check which Docker API version my engine supports?
Run docker version --format with {{.Server.APIVersion}} and {{.Server.MinAPIVersion}}. In the test it printed api 1.56 and min 1.40.
Why does docker version show downgraded from 1.56?
DOCKER_API_VERSION is set. The client then sends that version instead of its own. With the variable removed, docker version reported client api 1.56 in the test.

More decoded errors in the Fixes category.