UWSGI+Graphite+Ubuntu issues.

Asked by Bryan Bickford

I am trying to configure uwsgi to manage graphite.

Graphite was installed via the graphite-web package in ubuntu 14.04 by following this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an-ubuntu-14-04-server

Here is my uwsgi config for graphite(I have tried many iterations of this):

[uwsgi]
uid = _graphite
gid = _graphite
logto = /var/log/uwsgi/graphite.log
plugins = python ; have also tried python27
wsgi-file = /usr/share/graphite-web/graphite.wsgi
http-socket = :8080

I get the following error when trying to start the app:
Traceback (most recent call last):
  File "/usr/share/graphite-web/graphite.wsgi", line 13, in <module>
    from graphite.logger import log
ImportError: No module named graphite.logger

Here are the contents of /usr/share/graphite-web/graphite.wsgi:
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

# READ THIS
# Initializing the search index can be very expensive, please include
# the WSGIScriptImport directive pointing to this script in your vhost
# config to ensure the index is preloaded before any requests are handed
# to the process.
from graphite.logger import log
log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid())
import graphite.metrics.search

I have tried altering the above file only to surface more errors regarding the django configuration file. Since this was included in the distro packaging, I am assuming that I'm missing something in my uwsgi config file. google has not been very helpful.

Anyone use graphite behind uwsgi? Any tips for debugging further?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Bryan Bickford
Solved:
Last query:
Last reply:
Revision history for this message
Denis Zhdanov (deniszhdanov) said :
#1

Could you please try to add
sys.path.append('/opt/graphite/webapp')
to your WSGI config?
Or replace it with this version - https://raw.githubusercontent.com/deniszh/graphite-web/0.9.x_wsgi_example/conf/graphite.wsgi.example ?

Revision history for this message
Bryan Bickford (bryaw) said :
#2

Ended up ditching the Ubuntu packaging in favor of pip. This solved the problem.