Ask Your Question

nova-compute start failed with driver docker

asked 2013-11-15 02:04:57 -0600

tsjsdbd gravatar image

updated 2013-11-15 02:14:24 -0600

of course, i have installed docker and start the daemon by "service docker start", or "docker -d &"

with the config in /etc/nova/nova.conf

compute_driver = docker.DockerDriver

after start nova compute by command: "service nova-compute restart" the log show errors:

  1. ERROR stevedore.extension [-] Could not load 'file': (jsonschema 1.3.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('jsonschema>=0.7,<1'))

  2. NovaException: Docker daemon is not running or is not reachable (check the rights on /var/run/docker.sock)

so i check the second error first:

# ll /var/run/docker.sock
srw-rw---- 1 root docker 0 Nov 14 09:11 /var/run/docker.sock=

obviously, the file docker socket existed. and the docker command also take effect.

and from the code which pop the second error: vi /usr/lib/python2.7/dist-packages/nova/virt/docker/

+   def init_host(self, host):
+        if self.is_daemon_running() is False:
+            raise exception.NovaException(_('Docker daemon is not running or '
+                'is not reachable (check the rights on /var/run/docker.sock)'))

+    def is_daemon_running(self):
+        try:
+            self.docker.list_containers()
+            return True
+        except socket.error:

so the error come from Function docker.list_containers() vi /usr/lib/python2.7/dist-packages/nova/virt/docker/

+    def list_containers(self, _all=True):
+        resp = self.make_request(
+            'GET',
+            '/v1.3/containers/ps?all={0}&limit=50'.format(int(_all)))
+        return resp.json

so if thr docker is ok, maybe the problem is the first error, for here it return "resp.json".

then i try to resolve the stevedore conflict problem:

# apt-get install python-jsonschema=0.7-0ubuntu1

it downgrading python-jsonschema from 1.3.0-0ubuntu1~cloud0 to 0.7-0ubuntu1, but it also REMOVED packages: nova-common nova-compute nova-compute-kvm python-glance python-nova

when i install nova-compute again, the jsonschema version become to 1.3.0 as well.

so am i in dead loop? any help will be very appreciate~

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-11-17 21:49:51 -0600

tsjsdbd gravatar image

eventually, i find the culprit is the permission of the socket file. for i start docker by root. and start nova-compute actually is nova user(though i use "service nova-compute start" by root), user nova can't acess the socket file.

#sudo chmod 666 /var/run/docker.sock

then start nova compute, it is OK.(but the stevedore conflict problem still exist)

edit flag offensive delete link more


Would it not make more sense to add nova to group docker or use granular acl control (setfacl) instead of setting the whole socket to 666?

Nuriel gravatar imageNuriel ( 2013-12-17 08:04:48 -0600 )edit

answered 2014-12-14 16:57:33 -0600

dbaxps gravatar image

In meantime following (1.3.2) :-

usermod -G docker nova
systemctl restart openstack-nova-compute 
systemctl restart openstack-glance-api

works for me.

[root@juno ~]# ls -l /var/run/docker.*
-rw-r--r--. 1 root root   4 Dec 14 17:20 /var/run/
srw-rw----. 1 root docker 0 Dec 14 17:20 /var/run/docker.sock
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-11-15 02:04:57 -0600

Seen: 825 times

Last updated: Dec 14 '14