[modwsgi] mod_wsgi with graphite 0.9.6

305 views
Skip to first unread message

Craig Kimerer

unread,
Apr 28, 2010, 4:01:11 PM4/28/10
to mod...@googlegroups.com
Hello,

I tried searching through the archives but couldn't find something that is relating to my problem I am encountering.  I am trying to get graphite running on Ubuntu 9.10 / Apache 2.2.12 / mod_wsgi 2.5-1.

While running apache and going to the graphite address I get the following message in the apache error logs:
Could not import graphite.local_settings, using defaults!

The code logging this message can be found at http://bazaar.launchpad.net/~graphite-dev/graphite/main/annotate/head:/webapp/graphite/settings.py#L83

The site works (graphite.settings can be imported), however, it ignores the local_settings that I have defined (local_settings.py).  I am not entirely sure why local_settings cannot be imported as I can import from the python interpreter with the same 
import sys / 
sys.path.insert(0, '/opt/graphite/webapp')
import graphite.local_settings

mod_wsgi successfully imports the storage and remote_storage module successfully, and when checking those modules' __file__ it points to the path I would be expecting (the same directory as local_settings.py).

Any ideas?  Can I provide any other information that will help debug this problem?


Thanks in advance,
Craig

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To post to this group, send email to mod...@googlegroups.com.
To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.

Graham Dumpleton

unread,
Apr 28, 2010, 7:22:01 PM4/28/10
to mod...@googlegroups.com
On 29 April 2010 06:01, Craig Kimerer <craig....@gmail.com> wrote:
> Hello,
> I tried searching through the archives but couldn't find something that is
> relating to my problem I am encountering.  I am trying to get graphite
> running on Ubuntu 9.10 / Apache 2.2.12 / mod_wsgi 2.5-1.
> While running apache and going to the graphite address I get the following
> message in the apache error logs:
>
> Could not import graphite.local_settings, using defaults!
>
> The code logging this message can be found
> at http://bazaar.launchpad.net/~graphite-dev/graphite/main/annotate/head:/webapp/graphite/settings.py#L83
>
> The site works (graphite.settings can be imported), however, it ignores the
> local_settings that I have defined (local_settings.py).  I am not entirely
> sure why local_settings cannot be imported as I can import from the python
> interpreter with the same
>
> import sys /
> sys.path.insert(0, '/opt/graphite/webapp')
> import graphite.local_settings
>
> mod_wsgi successfully imports the storage and remote_storage module
> successfully, and when checking those modules' __file__ it points to the
> path I would be expecting (the same directory as local_settings.py).
> Any ideas?  Can I provide any other information that will help debug this
> problem?

Change the code to:


#Pull in overrides from local_settings.py

try:
from graphite.local_settings import *
except ImportError:
print >> sys.stderr, "Could not import graphite.local_settings,
using defaults!"
raise

So that the actual reason for the error isn't masked. This may give
you a better idea.

At a guess I would say the local settings file has restrictive
permissions so not readable by Apache user.

Ie., you have 'rw-rw----' instead of 'rw-rw-r--'.

Graham
Reply all
Reply to author
Forward
0 new messages