Error response from daemon: client is newer than server with Docker 1.9 RC3
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.
@TheSeanBrady Docker Machine si quite new. I'm sure that supporting a range of APIs is on some milestone of this project.
This isn't an issue with docker-machine, it's an issue with docker.
$ docker --version
Docker version 1.11.0, build 4dc5990
╰$ docker ps
Error response from daemon: client is newer than server (client API version: 1.23, server API version: 1.22)
╰$ brew switch docker 1.10.3
╰$ docker --version
Docker version 1.10.3, build 20f81dd
╰$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
All we need to do here is make the client support older versions the API. Why that wasn't a design requirement is odd.
What happens when a client from the future sends an API parameter that doesn't exist to a daemon which doesn't expect it? Or makes a request to an endpoint which doesn't exist in older versions? How is the daemon supposed to know about all the possible things a future client might request of it?
@nathanleclaire I'm not expert, but what I would expect is the same way the handshake was done on the old audio modems. The initial handshake was done using the oldest API, which is guaranteed to be understood by all clients and servers, and was guaranteed to at least respond to basic (vital) calls.
This handshake would just ask for: What API version are you using and the list of API functions it can respond to. Functions of client and servers are logically ANDed together and common set of functions (api calls) are set for THAT client-server configuration.
Based on that, the client would know what functions it can call and throw an error only on those it can't. I.E. [NotSupported] - Sorry, the server is unable to respond to _______. Please update the server to Docker nn.nnn.nn or modify your container to conform to Docker nn.nnn.nn
The idea is that if APIs only differ by 1%, that 1% doesn't disable the use of the other 99% that is most likely all that the client needed.
I think that there is ground for improvement. Handshaking and agreeing on a common protocol is not new and has been solved multiple times. Most of all, it would greatly improves usability.
Always remember that a system, no matter how good it is, if clients don't use it (or feel unsafe using it), is equivalent to nothing.
@ctroncoso I see your point, but if I run time docker info communicating with a server in amazonec2 / us-east-1 it takes a little over 300ms -- wouldn't a back-and-forth handshake for every request double this amount of time and introduce a non-trivial amount of overhead?
At any rate, there's nothing Machine can do about this issue, so I suggest an issue be opened (search for existing ones first) on https://github.com/docker/docker to share your thoughts with upstream if desired.
@nathanleclaire sure it would, but would you trade 20 x 300 (or 600)ms for an upgrade that is guaranteed to work? Also, it would be just for the first call. Maybe a "session key" can be generated on that first call that establishes that the handshake has already been made. and used on the following without re-handshaking. I'm sure that there are security issues that this might bring up, but I'd rather have a not-so-fast fail-proof system, than one that might introduce an unsuspected load of work just because ubuntu/fedora/centos didn't update its repos on time. I see that this is an docker-engine issue but machine is taking the blame.
I'll check on the issues on docker-engine. I think we've got a nice feature going here. I like it when issue talks end up in a constructive idea. Thanks for your time @nathanleclaire !!!
The client already queries the server for version. There should be no reason that the client would ever send an API parameter that doesn't exist, because the client SHOULD be aware of the params available for that version. Same goes for endpoints.
I would believe that this approach would require deprecation of older version at some point, perhaps based on age or version delta.
You simply cannot have the client choking on older versions though, it's not an option for production level deployments. I have 3 whole machines here and I have having this issue, image what would happen on dispersed deployments.
On Thu, Apr 21, 2016 at 2:47 PM, Nathan LeClaire [email protected] wrote:
All we need to do here is make the client support older versions the API. Why that wasn't a design requirement is odd.
What happens when a client from the future sends an API parameter that doesn't exist to a daemon which doesn't expect it? Or makes a request to an endpoint which doesn't exist in older versions? How is the daemon supposed to know about all the possible things a future client might request of it?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/docker/machine/issues/2147#issuecomment-213107758
The client already queries the server for version
Can you point me to where in the Docker client code this occurs?
I don't really know Go, but I'm fairly sure that's what this does:
https://github.com/docker/docker/blob/eab65e438ecc406baf935c8df544982164cff72f/integration-cli/docker_api_test.go
Either way you see a pattern of querying API version all over the project.
On Thu, Apr 21, 2016 at 5:25 PM, Nathan LeClaire [email protected] wrote:
The client already queries the server for version
Can you point me to where in the Docker client code this occurs?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/docker/machine/issues/2147#issuecomment-213157495
here is my method to resolve this issue: yesterday, when i made the newest version of docker from https://github.com/docker/docker.git referring to https://docs.docker.com/v1.5/contributing/devenvironment/ and modify the old docker client binary with the new one. there occurred "client is newer than server with Docker",and the docker daemon failed to restart:
- /bin/systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
but there are daemon binaries generated in the directory :
bundles/latest/binary-daemon
should add the directory to the PATH, or copy dockerd and containerd to the /usr/bin/
copy dockerd /usr/bin/docker
copy docker-containerd /usr/bin/containerd
copy ../binary-client/docker /usr/bin
then i modify /etc/init.d/docker to add the directory of the dockerd to PATH with the highlighted lines
DOCKERD=/home/master/github.com/docker/bundles/1.12.0-dev/binary-daemon export PATH=$PATH:$DOCKERD
BASE=dockerd
modify these in /etc/default/$BASE (/etc/default/docker) #DOCKER=/usr/bin/$BASE DOCKER=$DOCKERD/$BASE This is the pid file managed by docker itself DOCKER_PIDFILE=/var/run/$BASE.pid This is the pid file created/managed by start-stop-daemon DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid DOCKER_LOGFILE=/var/log/$BASE.log DOCKER_OPTS= DOCKER_DESC="Docker"
then i restarted the service of dockerd ,it start succefully: root@master:~# service docker status ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2016-05-04 04:32:01 EDT; 17h ago Docs: https://docs.docker.com
root@master:~# docker version Client: Version: 1.12.0-dev API version: 1.24 Go version: go1.5.4 Git commit: 1c0edf6-unsupported Built: Wed May 4 05:05:37 2016 OS/Arch: linux/amd64
Server: Version: 1.12.0-dev API version: 1.24 Go version: go1.5.4 Git commit: 1c0edf6-unsupported Built: Wed May 4 05:05:37 2016 OS/Arch: linux/amd64 root@master:~#
all run happy
just for reference
Hi, can someone please help me? I am having the same issue. I understand docker-machine upgrade would work but I am not using docker on Windows / MAC. I am using it on Linux.
I am following this instructions to make a test up for playing with docker content trust https://docs.docker.com/engine/security/trust/trust_sandbox/
In the dockerfile provided, it takes the 1.12.0 image and then creates the image , so when I run the container it does not connect to my base machine because my base machine (Linux) has 1.11.0 docker and this has 1.12.0 , so I then changed the docker file and passed the 1.11.0-dev path to it and generated the image again. This time when I ran the container with this new file, docker version is 1.11.0-dev only but API version is still 1.24 but my base Linux has API version of 1.23.
How do I get rid of this? How do I reduce my container API version to 1.23 or else increase my base API version to 1.,24 so that there will no errors?
P.S: I tried upgrading my base linux docker version but still API version is 1.23 only.
@mkonakan
On Ubuntu, sudo apt-get install -y docker-engine will update the natively installed version of Docker (Caveat: This will only work if you've installed Docker using the official channels)
docker-machine upgrade, as you noted, will update any boot2docker.iso you have to the latest version
@nathanleclaire Hi, upgraded my docker engine on my base ubuntu and it has latest 1.11.1 client version and API version 1.23 , but the container I built has 1.24 API version and hence there is the issue. So, I am looking for the way how can I downgrade my API version in container or else how can I upgrade my API version on base machine from 1.23 to 1.24?
@mkonakan Your best bet is probably to compile Docker from source, drop the binary into the relevant location, and restart the daemon. If the container you have built is using such a version of Docker it's likely that there's a line in the Dockerfile doing something similar.
Solved. I copied the binary file from my base machine to container instead of the default file in that dockerfile which is getting the latest API version. Thanks.
👍
Why is this closed? Is the latest docker client able to interface with older docker daemons?
@megastef Not that I'm aware of, but that's an issue of the upstream project (https://github.com/docker/docker), so I'd suggest looking for forwards compatibility issues there if you'd like to discuss.
i have the same problem,i try to use docker-machine upgrade name ,so pity that is doesn't work.i dont know if the network although use proxy,but i solved this problem.
1.find the toolbox from
2.download and install it ,then it will upgrade ur version.
docker-machine upgrade didn't work in my scenario. It seems that the CoreOS Docker Host is stuck at version 1.22. My client is running 1.24. How can I resolve this?