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

14

84

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.

Fala answered 5/7, 2014 at 12:45 Comment(4)
I have the same problem, using boot2docker. Is that also your case?Pointdevice
yes I'm also using boot2docker. after uninstalling docker and installing it again (not 'reinstall') its working again. brew uninstall docker && brew install dockerFala
Maybe you should edit the title / question to make it clear it is a boot2docker issue (for future reference).Pointdevice
Shameless plug: a friend and I put together a tool called Docker Version Manager to help with this in the short term.Sensitometer
T
127

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)

Talanian answered 6/7, 2014 at 11:39 Comment(5)
also brew uninstall docker && brew install docker did the jobFala
You no longer need to use the brew version of the docker command line tool. Boot2Docker provides the right version.Pavlodar
Having An error occurred trying to connect: Get https://192.168.59.103:2376/v1.19/containers/json?all=1: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103 :/Sixgun
I ran into this certificate issue, too. I ran boot2docker delete, then boot2docker init and it started working.Racemose
A friend and I put together a tool called Docker Version Manager to help with this in the short term.Sensitometer
O
19

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

Ostler answered 26/10, 2014 at 22:37 Comment(2)
For systemd it is recommended to do systemctl daemon-reload before systemctl restart dockerSteadfast
Seems like the simplest answer is the best answer :)Roughhouse
P
13

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.

Prong answered 3/5, 2015 at 14:44 Comment(0)
O
12

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
Odetteodeum answered 31/10, 2014 at 2:32 Comment(0)
S
11

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/

Sopor answered 31/3, 2016 at 13:26 Comment(2)
Thanks! this fixed my problemIndoxyl
The fact that the docker protocol is versioned and backward compatible must not be well documented, or visible enough, given the amount of answers that (understandably) go to all sorts of length to upgrade docker in various scenarios...Sopor
B
3

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

Belanger answered 30/3, 2016 at 3:8 Comment(0)
L
2

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

Lineal answered 20/1, 2015 at 3:41 Comment(0)
T
2

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.

Tidewaiter answered 19/4, 2015 at 20:21 Comment(0)
C
1

boot2docker delete

boot2docker init

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

Camaraderie answered 27/5, 2015 at 9:53 Comment(0)
M
1

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`
Magazine answered 10/7, 2015 at 21:1 Comment(0)
N
0

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.

Northernmost answered 4/11, 2014 at 8:30 Comment(0)
C
0

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.

Calomel answered 10/8, 2015 at 14:58 Comment(0)
I
0

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.

Ironmaster answered 22/1, 2016 at 11:35 Comment(0)
F
0

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

Footboard answered 4/4, 2017 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.