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.
This is not restricted to RC3 nor to docker machine. If the docker client is 1.9.x and the server is running docker 1.8.x, the error message is observed. This is very impractical in terms of managing deployments if you do not or cannot have the same docker engine version installed on all servers and all clients. I am of the opinion that this is quite a serious breakage.
Also basically the same issue as https://github.com/docker/machine/issues/1839
docker-machine upgrade <machine-name> worked also for me
docker-machine upgrade <machine-name> did not work for me. I had to upgrade all my servers to a dev build of docker, then I downgraded again and started getting:
docker: Error response from daemon: client is newer than server (client API version: 1.22, server API version: 1.21).
After the manual downgrade, I then ran docker-machine upgrade <machine-name>, but the error remains.
my fault ... I needed to delete the newer docker binary from my path.
docker-machine upgrade
Here's how I got it running after getting the same error for the 1.10.0-rc1:
docker-machine create -d=virtualbox -virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.10.0-rc1/boot2docker.iso docker
I had to run this for v1.10.0-rc2 / de3bb7a (OS X 10.10.5):
docker-machine create -d=virtualbox -virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.10.0-rc2/boot2docker.iso docker
boot2docker has been declared deprecated. Is this really the intended solution of the problem?
docker-machine still uses the boot2docker ISO to build the VM, that's nothing unusual.
It seems like there are lots of people confirming the upgrade of the docker daemon on the server (VM) but this does not address the case where the docker daemon cannot be immediately upgraded. The only quick and half-sensible solution I have found so far is to just download an appropriate client binary from the releases and run the right one depending on the server version.
boot2docker has been declared deprecated. Is this really the intended solution of the problem?
As @superdump notes, the boot2docker CLI (invoked using boot2docker on the command line) has been deprecated, but the OS still remains.
Thanks @nathanleclaire and @superdump for clarifying!
I've managed (sadly only temporarily) to solve the problem by installing dmv and downgrading via
dmv use 1.8.1
However, when pulling some images (but not all), docker keeps switching to 1.9.1 and nothing is shown under docker images any more (but it was before).
What is going on here? Is this a buggy/unstable version ?
There is a version B for the release candidate2
https://github.com/boot2docker/boot2docker/releases/tag/v1.10.0-rc2-b
use
docker-machine create -d=virtualbox -virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.10.0-rc2-b/boot2docker.iso docker
I just had this issue with my local mac (homebrew) running 1.10, while the docker-machine -- in this case on google gce, wouldn't work even after trying docker-machine upgrade. I had to manually ssh into it and specifically add the deb repo in order to force an upgrade to 1.10.
Just encountered that one on Travis CI:
$ export PATH=/opt/docker:$PATH
$ docker version
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 22:37:33 2016
OS/Arch: linux/amd64
Error response from daemon: client is newer than server (client API version: 1.22, server API version: 1.20)
The command "docker version" failed and exited with 1 during
I solved it after 3 days of debugging, and I wrote the answer on StackOverflow, you MUST check it http://stackoverflow.com/questions/24586573/docker-error-client-and-server-dont-have-same-version/36298911#36298911
That's still only about docker machine/docker toolbox. All of those proposals are workarounds and maybe are fine for using with docker toolbox but are not fine at all for real deployments of docker where different servers may have different server versions and not be able to be upgraded immediately.
The real problem is that newer docker clients cannot talk to older servers. This should ideally be fixed in docker itself somehow so that clients are backwards compatible.
This really is a show-stopping, stunning design flaw that really needs to be addressed immediately if docker-machine is to be a credible tool. The idea that I can't connect to a server instance now because the API version is OLDER is just, well, flabbergasting.
Unfortunately, clients are released fast, but clients take time to reach the repos. That is why when you upgrade a docker-machine (toolbox), the new version of the server might not be available and you are left disconnected from your machine.
What is strange, is that a newer client is unable to "speak" to older APIs.
The lag between official releases and repos updating to the new release is something that is not solvable. As I see it, this makes upgrading a client, a blind bet. Unless you are sure that your DM can be upgraded to the same client version, upgrading the client locks you out.
There are only two (any other?) options.
- Client must be able to talk to current API and at least 1 year-old apis.
- Server upgrade must check version available on official repos, and if it doesn't match, it should build if from source (or alternative repo).
All we need to do here is make the client support older versions the API. Why that wasn't a design requirement is odd.