kimchi-project / wok

A cherrypy framework for multi-purpose plug-ins
https://github.com/kimchi-project/wok/releases/latest
Other
236 stars 77 forks source link

Even after wokd service enabled, wokd service not comes up after reboot. #31

Closed archu-s closed 8 years ago

archu-s commented 8 years ago

Wokd fails to start on system boot, because of libvirtd not started before wokd.

Below is the logs from /var/log/messages:

Feb 1 18:36:32 zs95k4 kernel: end_request: I/O error, dev dasdd, sector 4206976 Feb 1 18:36:32 zs95k4 wokd: libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory Feb 1 18:36:32 zs95k4 wokd: Traceback (most recent call last): Feb 1 18:36:32 zs95k4 wokd: File "/usr/bin/wokd", line 97, in Feb 1 18:36:32 zs95k4 wokd: sys.exit(main(sys.argv[1:])) Feb 1 18:36:32 zs95k4 wokd: File "/usr/bin/wokd", line 94, in main Feb 1 18:36:32 zs95k4 wokd: wok.server.main(options) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/server.py", line 205, in main Feb 1 18:36:32 zs95k4 wokd: srv = Server(options) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/server.py", line 137, in init Feb 1 18:36:32 zs95k4 wokd: self._load_plugins(options) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/server.py", line 158, in _load_plugins Feb 1 18:36:32 zs95k4 wokd: plugin_app = import_class(plugin_class)(options) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/utils.py", line 126, in import_class Feb 1 18:36:32 zs95k4 wokd: mod = import_module(module_name, class_name) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/utils.py", line 136, in import_module Feb 1 18:36:32 zs95k4 wokd: return import(module_name, globals(), locals(), [class_name]) Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/init.py", line 20, in Feb 1 18:36:32 zs95k4 wokd: from ginger import Ginger Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/ginger.py", line 34, in Feb 1 18:36:32 zs95k4 wokd: from models import GingerModel Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/init.py", line 21, in Feb 1 18:36:32 zs95k4 wokd: from model import GingerModel Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/model.py", line 24, in Feb 1 18:36:32 zs95k4 wokd: from cfginterfaces import CfginterfaceModel, CfginterfacesModel Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/cfginterfaces.py", line 32, in Feb 1 18:36:32 zs95k4 wokd: from interfaces import InterfaceModel Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/interfaces.py", line 52, in Feb 1 18:36:32 zs95k4 wokd: class InterfaceModel(object): Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/interfaces.py", line 54, in InterfaceModel Feb 1 18:36:32 zs95k4 wokd: _conn = libvirt.open("qemu:///system") Feb 1 18:36:32 zs95k4 wokd: File "/usr/lib64/python2.7/site-packages/libvirt.py", line 255, in open

After adding 'After=libvirtd.service" in [Unit] section of "/usr/lib/systemd/system/wokd.service" solves the issue.

Patch will be following soon.

potula-chandra commented 8 years ago

I am working on it.

Will be sending patch soon !!!

pvital commented 8 years ago

What is the system (HW arch and distro) you are testing?

First, this is not a Wok issue since Libvirt is not required by it. Libvirt is dependency of Kimchi, that has a systemd configuration file to set wokd.service to start after libvirtd.service (see https://github.com/kimchi-project/kimchi/blob/master/contrib/kimchid.service.fedora).

I tested wok, wok+gingerbase, wok+gingerbase+kimchi installed in 3 different system (2 Fedora 23 and 1 Ubuntu 15.10) and in all of my tests I could reboot or start-up the system and wokd was enabled, up and running all the times I tested.

However, looking to the tracelog, the issue is generated by "/usr/lib/python2.7/site-packages/wok/plugins/ginger/models/interfaces.py" at line 54, a Ginger code that is using Libvirt. The best solution here is provide the same systemd configuration file to Ginger as Kimchi does.

I suggest to close this issue as 'not a bug' and open one into Ginger project.

potula-chandra commented 8 years ago

I fully agree with Paulo.

alinefm commented 8 years ago

Closing based on last comments.