Docker error: client and server don't have same version

DockerBoot2dockerDocker Machine

Docker Problem Overview


Since I just updated Docker to 1.1.0 I get:

> Error response from daemon: client and server don't have same version (client : 1.13, server: 1.12)

Do you know how to fix this?

I switched back to 1.0.1 and everything works again.

Docker Solutions


Solution 1 - Docker

It looks like you need to upgrade the VM after installing boot2docker:

> if you are upgrading from boot2docker 0.12 or later, you can update your existing virtual machine (after upgrading using the installer) using boot2docker stop && boot2docker download && boot2docker up - and you will not lose your existing data.

(https://github.com/boot2docker/osx-installer/releases/tag/v1.1.0)

Solution 2 - Docker

This can happen if you have updated Docker, but the service has not been restarted. You will then try to connect to the Docker daemon with the updated client, while the daemon (that was already running before the update) is still running the older version.

To fix this, restart the service:

sysV init:

service docker restart

systemd:

systemctl daemon-reload

systemctl restart docker

Solution 3 - Docker

In case you use docker-machine to manage a local VirtualBox-based machines the solution is as simple as for boot2docker:

docker-machine upgrade MACHINE_NAME

It asks docker-machine to download the latest boot2docker.iso and place it as a new root filesystem in the upgraded VM.

By the way, the VirtualBox-backed docker machine has its root filesystem readonly. That mean it's not possible for any manual update survive the machine reboot. That was a surprise for me.

Solution 4 - Docker

I had the latest version of boot2docker, docker and virtual box but was still receiving this message. It seems running brew upgrade boot2docker isn't the best idea. When running boot2docker upgrade, I was asked to set a bunch of environment variables and then it worked for me.

Boot2docker asked me to set these (see the last lines):

$ boot2docker upgrade
Latest release for boot2docker/boot2docker is v1.3.0
Downloading boot2docker ISO image...
Success: downloaded https://github.com/boot2docker/boot2docker/releases/download/v1.3.0/boot2docker.iso
	to /Users/.../.boot2docker/boot2docker.iso
Waiting for VM and Docker daemon to start...
.........oooooooooooooo
Started.
Writing /Users/.../.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/.../.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/.../.boot2docker/certs/boot2docker-vm/key.pem

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.103:2376
    export DOCKER_CERT_PATH=/Users/.../.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

It's possible to cut and paste those three lines in one go, into your terminal.

To check they are correct:

$ env

Solution 5 - Docker

I was trying to query a Docker server with a more recent client:

  • Server API version: 1.21
  • Client API version 1.22

The solution for me was to just:

export DOCKER_API_VERSION=1.21

Reference: https://docs.docker.com/engine/reference/commandline/cli/

Solution 6 - Docker

The correct answer here is very old (Docker have renamed boot2docker to Docker Machine and added some more functionality to it).

Anyway I faced the same problem and took me about 3 days to fix :(

Here's the solution

  1. find the location of the boot2docker.iso

    sudo find ~/ -name 'boot2docker.iso'

  2. delete the boot2docker.iso file, after taking a backup of it

    /Users/{user}/.docker/machine/cache/boot2docker.iso

  3. delete your docker vm

docker-machine rm {default}

this should delete that one as well:

/Users/{user}/.docker/machine/machines/default/boot2docker.iso

4) create new docker vm

docker-machine create --driver virtualbox default

this will download a new boot2docker.iso first and then use it to create your vm.

Now this should fix it :) BUT

> If you get any error here like:

Running pre-create checks...
(mega-docker) No default Boot2Docker ISO found locally, downloading the latest release...
Error with pre-create check: "Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on 192.168.0.1:53: read udp 192.168.0.103:53947->192.168.0.1:53: i/o timeout"

try to download the boot2docker.iso file manually by going to https://api.github.com/repos/boot2docker/boot2docker/releases/latest then clicking on the html_url and finally choosing to download the file.

once you get the file go and place it manually in /Users/{user}/.docker/machine/cache/

finally re-run this command docker-machine create --driver virtualbox default

Solution 7 - Docker

The only thing that worked for me was killing the process and starting it with "sudo service docker start".

Solution 8 - Docker

The only thing the worked for me was removing the boot2docker image from VirtualBox then completely deleting ~/.boot2docker folder, and finally running boot2docker init again.

Solution 9 - Docker

boot2docker delete

boot2docker init

worked for me. stop/start the deamon before and after that of course.

Solution 10 - Docker

This worked for me: It just shuts the vm down, deletes & recreates it and starts it up again. It re-runs shellinit so your ENV variables get set with the correct IP address when it comes back up.

$ boot2docker poweroff && \
    boot2docker delete && \
    boot2docker init && \
    boot2docker up
$ eval `boot2docker shellinit`

Solution 11 - Docker

I find the version in brew is outdated compared to the one on the docker.io website. Therefore I think the best way is go to the website and download the install file.

Solution 12 - Docker

I had the latest version of boot2docker(v1.7.1) and got the client server mismatch error. Then I just ran boot2docker upgrade and it solved the problem.

Solution 13 - Docker

Ansible Answer:

If you came there by Ansible and not boot2docker, here is the solution: Use the docker_api_version: auto argument

- name: Mongo data container
  docker:
    docker_api_version: auto
    name: mongo-primary-dc
    image: debian:wheezy
    state: present
    volumes:
    - /data

I guess the reason is that the docker-py module used by Ansible is often not at the same version as the Ubuntu apt-get repository.

Solution 14 - Docker

My solution was to do a Close > Power Off on the docker VM in VirtualBox, and then restart Kitematic. This fixed it for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsoenkeView Question on Stackoverflow
Solution 1 - DockerAbel MuiñoView Answer on Stackoverflow
Solution 2 - DockerBakaKunaView Answer on Stackoverflow
Solution 3 - DockerPeterView Answer on Stackoverflow
Solution 4 - DockerRimianView Answer on Stackoverflow
Solution 5 - DockerMarcello RomaniView Answer on Stackoverflow
Solution 6 - DockerMahmoud ZaltView Answer on Stackoverflow
Solution 7 - DockerpawlView Answer on Stackoverflow
Solution 8 - DockerdkinzerView Answer on Stackoverflow
Solution 9 - DockerapfliegerView Answer on Stackoverflow
Solution 10 - Docker0xADADAView Answer on Stackoverflow
Solution 11 - DockerTommyView Answer on Stackoverflow
Solution 12 - DockerSamithaView Answer on Stackoverflow
Solution 13 - DockerNicolas ZozolView Answer on Stackoverflow
Solution 14 - DockerourmaninamsterdamView Answer on Stackoverflow