Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - Error response from daemon: client is newer than server

After creating a new machine with Docker Machine, I'm getting the following error:

enter image description here

$ docker ps
Error response from daemon: client is newer than server(client API version 1.21, server API version: 1.19)

How can I fix this?

like image 681
Marc Perrin-Pelletier Avatar asked Dec 01 '15 07:12

Marc Perrin-Pelletier


3 Answers

docker-machine upgrade <your-machine>

will do the trick. This can happen - as it did for me - even if you're not using RCs and your machine was newly created. It would be due to an ISO cache issue. The error is commented in this thread.

If the docker client is 1.9.x and the server is running docker 1.8.x, the error message is observed.

like image 195
Marc Perrin-Pelletier Avatar answered Nov 12 '22 19:11

Marc Perrin-Pelletier


If someone happens to get this error, but is not using docker-machine, there is another way to resolve the issue by specifying an older API version in an environment variable on the client side:

export DOCKER_API_VERSION=<version>

for example:

export DOCKER_API_VERSION=1.19

and retrying the docker command.

Reference.

like image 20
techraf Avatar answered Nov 12 '22 18:11

techraf


On ubuntu distrib it happens after an apt update, if docker run as a service. The client is updated but the old version of the server is still running.

In this case just do a:

sudo service docker restart
like image 13
Clément Cazeaux Avatar answered Nov 12 '22 20:11

Clément Cazeaux