Closed twang2218 closed 7 years ago
Confirming the same for me:
docker-machine create --driver vultr --vultr-api-key=$VULTR_TOKEN --vultr-region-id=2 --vultr-plan-id=29 --vultr-os-id=215 example.com
Running pre-create checks...
(example.com) Validating Vultr VPS parameters...
Creating machine...
(example.com) Creating Vultr VPS...
(example.com) Waiting for IP address to become available...
(example.com) Created Vultr VPS ID: 6342286, Public IP: 45.63.79.223, Private IP:
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Error creating machine: Error running provisioning: Something went wrong running an SSH command!
command : sudo apt-get update
err : exit status 100
output : Reading package lists...
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
This is happening because vultr runs update scripts once you instantiate. They should not be doing this. Please create a support case and ask them to:
Known issue. I wished Vultr wouldn't do that stuff. Might be worth bringing this up with the Docker Machine devs though.
Thoughts, @gsmaul ?
@lvnilesh - that's only partially true. All Vultr operating system images are configured not to run system updates upon deployment. We refresh our images often so that they get updated packages, but this doesn't happen at deploy time.
However, Ubuntu 16.04 and 16.10 has an "apt-daily.service" that runs after the VM is booted, which causes the apt lock errors you're seeing. We considered disabling it on Vultr, but that system is part of Ubuntu and performs OS related tasks. We didn't want to open up new security issues and possible upgrade problems, so we left it alone. Our goal is to provide basically as close to the upstream installation as possible, with just a few minor changes to get the Vultr features (like custom hostname) working.
There's some more discussion on it here: http://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image
@twang2218, there is a fix for the apt-get locking in docker-machine v0.9.0. https://github.com/docker/machine/pull/3891
Please re-open this ticket if upgrading does not fix it for you.
Hi. I'm facing the same issue with Mac OS, Docker 17.06.2-ce, docker-machine version 0.12.2.
Here is the log:
As you can see, the
sudo apt-get update
command cannot execute as there is anotherapt-get
running in the background, maybe because the system setup script running for the first time.I think we should wait for a little longer or wait until the other apt exit.