Skip to content
This repository has been archived by the owner on Jan 17, 2018. It is now read-only.

start before docker.service #29

Closed
awyl opened this issue May 5, 2016 · 8 comments
Closed

start before docker.service #29

awyl opened this issue May 5, 2016 · 8 comments

Comments

@awyl
Copy link

awyl commented May 5, 2016

AzureFile volume driver should start before docker.

The reason is when using docker run --restart with the volume driver, auto restart will failed because the driver is not available until docker started.

Changing the .service file, as following works:
After=nfs-utils.service docker.service to
Before=nfs-utils.service docker.service

@ahmetb
Copy link
Contributor

ahmetb commented May 5, 2016

@awyl thanks for reporting this. In my tests with docker 1.10 or above, I noticed no difference between before/after and I kind of remember asking about this on #docker-dev IRC channel. Folks did not seem to have a consensus, because normally Docker retries any plugin communication for 30 seconds (and during that time, containers with --restart=always should be blocked from starting until the plugin is reachable).

Do you have any logs about these containers failed to start? Also what version of docker-engine are you running?

In any case if we were to take the change, we should probably keep After=nfs-utils.service and separate Before=docker.service.

@awyl
Copy link
Author

awyl commented May 5, 2016

Sorry I am not very familiar with Linux and Docker. Where can I look for the logs?

I am using Docker on Ubuntu image on Azure. Ubuntu 15.10 and Docker is 1.11.1.

Where I saw the "could not start" message was from "systemctl status docker.service". It said the volume cannot be found.

I am sure that after boot the container has not been started after a long time while I was looking for reasons.

@ahmetb
Copy link
Contributor

ahmetb commented May 5, 2016

@awyl can you try sudo journalctl -u docker.service?

@awyl
Copy link
Author

awyl commented May 6, 2016

I cannot get journalctl to show the full line. So I try again with systemctl:

May 06 00:54:06 docker01 docker[666]: .time="2016-05-06T00:54:06.607288800Z" level=warning msg="Unable to locate plugin: azurefile, retrying in 1s"
May 06 00:54:07 docker01 docker[666]: time="2016-05-06T00:54:07.607475100Z" level=warning msg="Unable to locate plugin: azurefile, retrying in 2s"
May 06 00:54:09 docker01 docker[666]: time="2016-05-06T00:54:09.612964300Z" level=warning msg="Unable to locate plugin: azurefile, retrying in 4s"
May 06 00:54:13 docker01 docker[666]: time="2016-05-06T00:54:13.613335400Z" level=warning msg="Unable to locate plugin: azurefile, retrying in 8s"
May 06 00:54:21 docker01 docker[666]: time="2016-05-06T00:54:21.905119000Z" level=error msg="Failed to start container 21da2ff86d0576708eec1be475d5a467f9357fc228edbc0913084b48f6263f15: get servernginx: Error looking up volume plugin azurefile: plugin not found"
May 06 00:54:21 docker01 docker[666]: time="2016-05-06T00:54:21.905581600Z" level=info msg="Loading containers: done."
May 06 00:54:21 docker01 docker[666]: time="2016-05-06T00:54:21.905792200Z" level=info msg="Daemon has completed initialization"
May 06 00:54:21 docker01 docker[666]: time="2016-05-06T00:54:21.905987900Z" level=info msg="Docker daemon" commit=5604cbe graphdriver=aufs version=1.11.1
May 06 00:54:21 docker01 systemd[1]: Started Docker Application Container Engine.
May 06 00:54:21 docker01 docker[666]: time="2016-05-06T00:54:21.931319900Z" level=info msg="API listen on /var/run/docker.sock"

So it did retry and fail.

@ahmetb
Copy link
Contributor

ahmetb commented May 6, 2016

@awyl oh interesting, it appears like it is not starting docker engine until loading all its previous containers. This behavior might have been changed lately. We should fix the .service unit file. Thanks for reporting!

@ahmetb
Copy link
Contributor

ahmetb commented May 25, 2016

@awyl has doing

 After=nfs-utils.service
 Before=docker.service

fixed the problem for you?

@awyl
Copy link
Author

awyl commented May 28, 2016

Yes it does. This is what I currently have.

@ahmetb
Copy link
Contributor

ahmetb commented May 31, 2016

@awyl thanks for confirming. I'm submitting a fix.

@ahmetb ahmetb closed this as completed in af5fe5a May 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants