Machine: Can't upgrade from 17.05 to 17.06

Created on 4 Jul 2017  Â·  7Comments  Â·  Source: docker/machine

What I do

$ docker-machine upgrade my-machine

What I expect to see

My machine being update from 17.05 to 17.06.

What I see instead

Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
ssh command error:
command : DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y  docker-ce
err     : exit status 100
output  : Reading package lists...
Building dependency tree...
Reading state information...
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker-ce' has no installation candidate

Extra information

$ docker-machine -v
docker-machine version 0.12.1, build c8b17e8

My machine is running Ubuntu on a Amazon t2.medium instance.

Most helpful comment

Honestly, I understand that workaround, however, when someone runs 'docker-machine upgrade’ they are going to break the machine right there - no docker commands execute and a live site or application goes down. With the fire drill going on (thankfully in my case just a staging site), but it’s now been a week and I am finally understanding the issue after breaking the site, troubleshooting as best as I could before starting over and then immediately running into the 'docker-machine create’ bugs and spending nearly 20 hours troubleshooting and scouring docker-machine issues. I feel very bad for the people that are about to run into that on a production instance.

All 7 comments

Seems that before 0.12.0 the docker package in Ubuntu or Debian is called docker-engine but now in 0.12.1 is called docker-ce. So docker-machine is trying to upgrade a package that is not there or is not installed.

Yes, @debianw is correct. We would have to rewrite the upgrade code to take this case into account. Unfortunately, I won't be able to afford spending time on this any time soon. Until then, I'd suggest SSHing into the machine and doing the upgrade manually.

Honestly, I understand that workaround, however, when someone runs 'docker-machine upgrade’ they are going to break the machine right there - no docker commands execute and a live site or application goes down. With the fire drill going on (thankfully in my case just a staging site), but it’s now been a week and I am finally understanding the issue after breaking the site, troubleshooting as best as I could before starting over and then immediately running into the 'docker-machine create’ bugs and spending nearly 20 hours troubleshooting and scouring docker-machine issues. I feel very bad for the people that are about to run into that on a production instance.

@shin- I understand that there is a limitation of resources, but to be honest, you should think about removing the upgrade command altogether (and update the docs how to do an upgrade). See also https://github.com/docker/machine/issues/3308

I can't remember having a working seamless upgrade of a Docker machine and I tried this several dozen times.

It works fine if you upgrade from any version higher than 17.06.
The error that I incurred in was because of the package name different (it now is docker-ce).
To solve this I manually updated all my machines with version < 17.06, not upgrade works fine using Docker Machine 1.12.2+.
One tricky thing that you might be missing during the manual upgrade is to modify /etc/systemd/system/docker.service.d/10-machine.conf on your host, in my case (on EC2):

OLD:

[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=amazonec2
Environment=

NEW (17.06+), no more docker daemon but dockerd instead:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=amazonec2
Environment=

Hope this helps.

At LEAST provide some logic to check compatibility during an upgrade command...wouldn’t be that complicated and would stop these problems and tickets...can’t imagine it would take much more time than the time wasted with these tickets?

It works fine if you upgrade from any version higher than 17.06.

I was trying to upgrade from 17.07 on a Debian host (generic provisioner).

I had issues upgrading on AWS (a while ago) and also on Ubuntu (various versions) and on my Mac with boot2docker.

It's no offense. But the upgrade command just breaks things so often.

Was this page helpful?
0 / 5 - 0 ratings