machine icon indicating copy to clipboard operation
machine copied to clipboard

Error response from daemon: client is newer than server with Docker 1.9 RC3

Open arun-gupta opened this issue 11 years ago • 72 comments

Here is the version information:

> docker-machine -v
docker-machine version 0.5.0-rc3 (a1e610b)
> docker -v
Docker version 1.9.0-rc3, build 2100b94

Created a Docker machine:

> docker-machine create -d=virtualbox lab2
Running pre-create checks...
Creating machine...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env lab2

Configured as:

eval $(docker-machine env lab2)

docker ps gives the following error:

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

This is a newly created machine using the latest version of Docker CLI and Docker Machine.

arun-gupta avatar Nov 03 '15 06:11 arun-gupta

@pcgeek86 try export DOCKER_API_VERSION=1.23 (see https://forums.docker.com/t/docker-for-mac-stopped-running-docker-related-commands/16153/6)

eddieajau avatar Jun 28 '16 00:06 eddieajau

For the people that find this having the same issue on Windows, use $env:DOCKER_API_VERSION=1.23 to set the environment variable.

LEChaney avatar Jul 13 '16 08:07 LEChaney

I was having this issue as well, with the Windows beta. docker-machine upgrade did not help. One alternative solution is to add --engine-install-url https://test.docker.com to docker-machine create, which will initialize the machine with the latest release candidate of Docker.

Details:

> docker -v
Docker version 1.12.0-rc4, build e4a0dbc, experimental
> docker-machine -v
docker-machine version 0.8.0-rc2, build 4ca1b85

> docker-machine create --driver amazonec2 aws01
> @FOR /f "tokens=*" %i IN ('docker-machine env aws01') DO @%i
> docker ps
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)
(Here we could have used SET DOCKER_API_VERSION=1.23)

> docker-machine create --driver amazonec2 --engine-install-url https://test.docker.com aws02
> @FOR /f "tokens=*" %i IN ('docker-machine env aws02') DO @%i
> docker ps
(Works!)

mjiderhamn avatar Jul 18 '16 10:07 mjiderhamn

Can this one be fixed (or perhaps worked around) by adding the DOCKER_API_VERSION to the output of docker-machine env?

replaid avatar Jul 28 '16 21:07 replaid

I solved the problem thanks to @eddieajau.

My docker client (DOCKER_API_VERSION=1.24) is Ubuntu linux and the docker server (DOCKER_API_VERSION=1.23) is at Carina by Rackspace BETA.

Just add export DOCKER_API_VERSION=1.23 to your client to make it work.

Thanks.

jcroldan avatar Aug 05 '16 08:08 jcroldan

export DOCKER_API_VERSION=1.23 solved my problem. thanks to @eddieajau

kid1412z avatar Aug 10 '16 07:08 kid1412z

Thank you @kid1412z it worked for me too as a quick fix.

marcusradell avatar Aug 20 '16 20:08 marcusradell

Back to the older version

brew uninstall docker
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ba2a4f0358395010e84346d2224378c74d76c527/Formula/docker.rb
brew pin docker

twlz0ne avatar Aug 25 '16 02:08 twlz0ne

omg. negotiating protocol versions isn't a thing that still needs to be invented. i've worked with software from the 90s that could handle this. yuck, really.

FlorianHeigl avatar Oct 14 '17 22:10 FlorianHeigl

@FlorianHeigl docker client 1.13 and higher does API version negotiation with the daemon; the minimum daemon version that it will fall back to is docker 1.12. For older daemons, the DOCKER_API_VERSION override is needed

thaJeztah avatar Oct 15 '17 04:10 thaJeztah

@eddieajau The workaround of the environment variable DOCKER_API_VERSION=1.23 doesn't work anymore. I use docker for Windows and I'm connecting to a docker server running on a NAS that I cannot update.

Windows:

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:45:38 2017
 OS/Arch:      linux/amd64
 Experimental: true

Nas:

Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   781516c
 Built:        Thu Aug  3 16:04:05 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   781516c
 Built:        Thu Aug  3 16:04:05 2017
 OS/Arch:      linux/amd64

Does anyone have an idea?

norcino avatar Oct 24 '17 21:10 norcino

@manuelsalvatori that's an issue in the docker 17.09 cli; it's fixed in 17.10 (see https://github.com/moby/moby/pull/35008)., not yet backported to 17.09.

Be aware that docker 1.11 is end of life though, and has known vulnerabilities, among which a CVE in RunC that allows container processes to break out of the container and get access to the host (resolved in docker 1.12.6 and up, which ship with a patched RunC version https://github.com/moby/moby/releases/tag/v1.12.6)

thaJeztah avatar Oct 24 '17 21:10 thaJeztah