Docker: "Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39
Problem
- An error response related to the maximum supported API version is received from the Docker daemon upon running any CLI commands, e.g.
- The docker-ce package has an internal dependency on docker-ce-cli but the dependent package version is not locked. The latest version of the CLI gets installed implicitly as part of this dependency. However, on May 15th, 2020, a new version of the CLI was released that broke compatibility with the docker-ce 18.09.9 version.
Note:This issue is likely to have impacted any nodes added between May 15th, 2020 and May 28th, 2020. Verify your Docker CLI version is impacted before proceeding with resolution steps. These steps may not be effective in resolving issues encountered with other versions of the client.
Environment
- Platform9 Managed Kubernetes - All Versions
- Docker Client v19.03.9
Cause
docker-ce-cli(client) v19.03.9 fails to downgrade its API version to match the server, as recognized in docker/cli#2533. This has now been rectified with the latest release pushed out May 29th, 2020, Docker Client v19.03.10.
Resolution
As mentioned above, Docker has pushed a release with a fix. Please use the steps below to ensure you have the latest release.
Ubuntu
- Run the following command to update the package metadata.
Setup the Docker repository.
- Setup apt utilities.
# apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
- Download Docker GPG key.
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Add Docker repository to your host.
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- Install the latest version of docker-ce-cli.
CentOS
Setup the Docker repository.
- Add yum-utils.
# yum install -y yum-utils
- Add Docker repository to your host.
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Note: CentOS may ask you to accept the GPG key for this repository when you install something from the repository in the next step.
- Install the latest version of docker-ce-cli.