Can't Start Carbon - 12.04 - Python Error - ImportError: cannot import name daemonize
Asked Answered
K

5

23

I am really hoping someone can help me as I have spent at-least 15 hours trying to fix this problem. I have been given a task by a potential employer and my solution is to use graphite/carbon/collectd. I am trying to run and install carbon / graphite 0.9.12 but I simply can't get carbon to start. Every time I try and start carbon I end up with the following error. I am using a bash script to install to keep everything consistent.

I don't really know python at all so would appreciate any help you can provide.

/etc/rc0.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc1.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc6.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc2.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc3.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc4.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc5.d/S20carbon-cache -> ../init.d/carbon-cache


Traceback (most recent call last):
File "/opt/graphite/bin/carbon-cache.py", 
line 28, in from carbon.util import run_twistd_plugin
File        "/opt/graphite/lib/carbon/util.py", 
line 21, in from twisted.scripts._twistd_unix import daemonize 
ImportError: cannot import name daemonize

Thanks

Shane

Kingly answered 10/11, 2013 at 20:22 Comment(0)
O
46
pip install 'Twisted<12.0'

As you can see in the requirements.txt, the newer version of Twisted does not seems to play well with it

Observant answered 12/11, 2013 at 12:35 Comment(3)
Works for me too. pip list | grep -i twist showed Twisted (14.0.0). When I did pip uninstall Twisted then installed Twisted<12.0, carbon was able to start.Shipentine
Solved the exact same issue as above – Ubuntu 12.04Nightingale
pip install Twisted==13.0Vola
L
21
pip install daemonize

then I opened /opt/graphite/lib/carbon/util.py and changed

from twisted.scripts._twistd_unix import daemonize

to

import daemonize
Landa answered 11/11, 2013 at 22:0 Comment(2)
it works!. I'm curious that will graphite will fix this or we will have to patch this manually everytime? Is there anyway to avoid manual update /opt/graphite/lib/carbon/util.py?Reich
I will answer my own question, do: pip install Twisted==11.1.0Reich
D
2

I tried with pip install Twisted==11.1.0 but not got it downgrade my Twisted version. So, i renamed /usr/lib/python2.7/dist-packages/twisted/ to other name. After i install twisted pip install Twisted==11.1.0 and sudo ./bin/carbon-cache.py start works.

Dermatoid answered 19/11, 2014 at 18:35 Comment(0)
L
1

You can likely remove refences to daemonize from lib/carbon/util.py and then it seems to work with twisted 13.2.0. See carbon github commit 1d0bdc5c6ac331fdcb6f6c0f897507fcf833f616 from Nov 18 2013

https://github.com/graphite-project/carbon/commit/1d0bdc5c6ac331fdcb6f6c0f897507fcf833f616

Luisluisa answered 20/7, 2014 at 2:12 Comment(0)
B
0

Newest version of Twisted won't work.

Install version 13.0:

pip install http://twistedmatrix.com/Releases/Twisted/13.0/Twisted-13.0.0.tar.bz2
Braun answered 15/5, 2014 at 12:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.