brutasse / graphite-cyanite

A plugin for using graphite-web with the cassandra-based Cyanite storage backend.
BSD 3-Clause "New" or "Revised" License
85 stars 21 forks source link

'module' object has no attribute 'CyaniteFinder' error #9

Closed ogg1e closed 9 years ago

ogg1e commented 9 years ago

Getting this error when using graphite-web on top of cyanite.

'module' object has no attribute 'CyaniteFinder'
Request Method: GET
Request URL:    http://10.6.70.19/
Django Version: 1.4.14
Exception Type: AttributeError
Exception Value:    
'module' object has no attribute 'CyaniteFinder'
Exception Location: /opt/graphite/webapp/graphite/storage.py in get_finder, line 20
Python Executable:  /usr/bin/python
Python Version: 2.6.6
Python Path:    
['/usr/lib/python2.6/site-packages/supervisor-3.1.3-py2.6.egg',
 '/usr/lib/python2.6/site-packages/meld3-1.0.0-py2.6.egg',
 '/usr/lib/python2.6/site-packages/superlance-0.11-py2.6.egg',
 '/usr/lib64/python26.zip',
 '/usr/lib64/python2.6',
 '/usr/lib64/python2.6/plat-linux2',
 '/usr/lib64/python2.6/lib-tk',
 '/usr/lib64/python2.6/lib-old',
 '/usr/lib64/python2.6/lib-dynload',
 '/usr/lib64/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
 '/opt/graphite/webapp']

The application was previously working but now throws this error no matter what. The inbound apps are still able to write to graphite and data is still being stored in cassandra through cyanite. And other tools are still able to read from cyanite. So everything else seems to be working ok except for graphite-web.

ogg1e commented 9 years ago

It turns out that if you install the project cyanite-utils on the same box as this project, then you get this conflict. Removing one or renaming the modules will fix it.

brutasse commented 9 years ago

Oh thanks for letting me know, I had no idea cyanite-utils claims the same namespace :) Just filed an issue there.

WrathOfChris commented 9 years ago

I had no idea I was claiming the same namespace either :)

@ogg1e I don't see any obvious class names conflicting ... is it just that we both have things referred to as 'cyanite'?

ogg1e commented 9 years ago

I think so. It seems both projects are using cyanite.. The moment I removed cyanite-utils graphite started working again. It's the fact that both are python and loading modules with the same name "cyanite." and since I installed cyanite-utils after graphite, it replaced the graphite one and that's why it couldn't find cyanite.CyaniteFinder.

brutasse commented 9 years ago

Yeah it's not a matter of class names, just the root cyanite. prefix. In Python packaging the installer removes everything under the package prefix if there is already something installed (it thinks it's an older version). So if you install graphite-cyanite then graphite-utils, pip installs the first one properly then removes it before installing graphite-utils.

If the root dir of cyanite-utils were named cyanite_utils there'd be no conflict :)

WrathOfChris commented 9 years ago

Thanks for the background, didn't know that's how pip managed it. I have no problem renaming cyanite_utils, so will pop that into the next version.

brutasse commented 9 years ago

:+1: