gingerlime/graphite-fabric

Fabric fails to start carbon-cache.py on Ubuntu because of missing twisted packages

Closed this issue · 7 comments

Had the following failure, seems to work if I add "twisted python" to the list of installed packages in fabfile.py.

[root@precise64] sudo: /etc/init.d/carbon start
[root@precise64] out: Starting script carbon
[root@precise64] out: Traceback (most recent call last):
[root@precise64] out:   File "/opt/graphite/bin/carbon-cache.py", line 28, in <module>
[root@precise64] out:     from carbon.util import run_twistd_plugin
[root@precise64] out:   File "/opt/graphite/lib/carbon/util.py", line 21, in <module>
[root@precise64] out:     from twisted.scripts._twistd_unix import daemonize
[root@precise64] out: ImportError: cannot import name daemonize
[root@precise64] out: 

Hi @centic9

That's strange. I haven't experienced somthing like this, but it could be that one of the packages that are installed had a dependency on twisted before, and now it doesn't so it doesn't get installed. Or perhaps all the platforms I was running this on already had twisted pre-installed. I can try to have a look.

Can I ask you on which platform you install this on? (e.g. EC2 - if so which AMI are you using? Vagrant? Linode?). This could help trying to reproduce the problem.

Just a local test using Vagrant on Windows to create a VirtualBox using the included Vagrantfile (i.e. a precise64 box) and then "vagrant ssh" into it and ran the fabric command "fab graphite_install -H root@{hostname}" (I am not using fab vagrant" as I didn't want to mess with installing python modules on Windows).

After adding python-twisted in the fabfile installation works. See also centic9@7937d49

Found a few links about similar problems, but this one seems the most relevant graphite-project/carbon#180 and graphite-project/carbon#184

So I guess carbon doesn't even need daemonize, and this was removed. I'll take a look and see if I can use the latest 0.9.x carbon version instead of the pypi version, which would also then get rid of this problem.

@centic9 - I made a fix that uses the latest 0.9.x branch from the graphite project. It contains quite a few bug fixes, that somehow get delayed going into pypi, so it seems like a sensible change that could improve other things as well. I recommend you use the latest version instead of your own fix, but it's up to you of course.

Thanks very much for reporting this. Your help was much appreciated.

Thanks for the fast response, I'll give it a try, please note that protocols like "git://" or "git+git://" are not likely to work inside a corporate environment with firewalls in place, I am changing those to https:// locally in order to make it work.

Ideally the installation should go through pypi, and I've asked the Graphite project, but there's no clear estimate when things will be pushed to pypi from the 0.9.x branch. Latest update for carbon was Aug 2013, so things are running a bit slower than I'd hope for.

I thought pip knows how to handle those links and uses https/ssh under the hood, but (luckily for me) I'm not working in a corporate environment these days :)

I've updated git:// links to https://