# 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.

{% tabs %}
{% tab title="None" %}

```none
# docker version
Client: Docker Engine - Community 
Version:           19.03.9 
API version:       1.40 
Go version:        go1.13.10 
Git commit:        9d988398e7 
Built:             Fri May 15 00:25:34 2020 
OS/Arch:           linux/amd64 
Experimental:      false
Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39
```

{% endtab %}
{% endtabs %}

* 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.

{% tabs %}
{% tab title="None" %}

```none
$ docker version
Client: Docker Engine - Community Version: 19.03.9 ...
```

{% endtab %}
{% endtabs %}

## 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](https://github.com/docker/cli/issues/2533). This has now been rectified with the latest release pushed out May 29th, 2020, [Docker Client v19.03.10](https://docs.docker.com/engine/release-notes/#190310).

## 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

1. Run the following command to update the package metadata.

{% tabs %}
{% tab title="None" %}

```none
# apt-get update
```

{% endtab %}
{% endtabs %}

2. Setup the Docker repository.
   * Setup apt utilities.

{% tabs %}
{% tab title="Bash" %}

```bash
# apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
```

{% endtab %}
{% endtabs %}

* Download Docker GPG key.

{% tabs %}
{% tab title="Bash" %}

```bash
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```

{% endtab %}
{% endtabs %}

* Add Docker repository to your host.

{% tabs %}
{% tab title="Bash" %}

```bash
# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```

{% endtab %}
{% endtabs %}

3. Install the latest version of **docker-ce-cli**.

{% tabs %}
{% tab title="None" %}

```none
# apt-get install docker-ce-cli
```

{% endtab %}
{% endtabs %}

### CentOS

1. Setup the Docker repository.
   * Add **yum-utils**.

{% tabs %}
{% tab title="Bash" %}

```bash
# yum install -y yum-utils
```

{% endtab %}
{% endtabs %}

```
- Add Docker repository to your host.
```

{% tabs %}
{% tab title="Bash" %}

```bash
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```

{% endtab %}
{% endtabs %}

**Note:** CentOS may ask you to accept the GPG key for this repository when you install something from the repository in the next step.

2. Install the latest version of **docker-ce-cli**.

{% tabs %}
{% tab title="None" %}

```none
# yum install docker-ce-cli
```

{% endtab %}
{% endtabs %}
