← Back to team overview

graphite-dev team mailing list archive

[Question #248678]: Graphite dashboard Import Error with Apache/2.4.9 with wsgi on RHEL 5.6

 

New question #248678 on Graphite:
https://answers.launchpad.net/graphite/+question/248678

Please help me get through this issue , I have tried all ways from my side could not get through the problem.It was working for few weeks and broke all of a sudden without we doing any changes knowingly.
I am getting a cairo import error when accessing graphite dashboard in the browser.When we try running cairo import in commandline as apache user it works fine.We have installed Python and all other modules from source in custom path.I have enabled DEBUG = True in your Django settings file and i get this error 


------------------------------------------------------------------------------------------------------------------------------------------------------------
Apache envvars:
--------------
if test "x$LD_LIBRARY_PATH" != "x" ; then
  LD_LIBRARY_PATH="/home/Python-2.7.3/lib:/home/Python-2.7.3/lib/python2.7/site-packages:/home/stats/webserver/lib:$LD_LIBRARY_PATH"
else
  LD_LIBRARY_PATH="/home/Python-2.7.3/lib:/home/Python-2.7.3/lib/python2.7/site-packages:/home/stats/webserver/lib"
fi
export LD_LIBRARY_PATH


Apache virtual host conf:
-------------------------

WSGISocketPrefix /home/stats/webserver/logs/runwsgi
WSGIPythonPath /home/Python-2.7.3
 
 <VirtualHost *:8990>
        ServerName graphite
        DocumentRoot "/home/stats/app/graphite/webapp"
        ErrorLog /home/stats/app/graphite/storage/log/webapp/error.log
        CustomLog /home/stats/app/graphite/storage/log/webapp/access.log common
        
        Header set Access-Control-Allow-Origin "*"
        Header set Access-Control-Allow-Methods "GET, OPTIONS"
        Header set Access-Control-Allow-Headers "origin, authorization, accept"

        SetEnv GRAPHITE_URL http://graphite-host.domain.com:8990

        # I've found that an equal number of processes & threads tends
        # to show the best performance for Graphite (ymmv).
        WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
        WSGIProcessGroup graphite
        WSGIApplicationGroup %{GLOBAL}
        WSGIImportScript /home/stats/app/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL}

        # XXX You will need to create this file! There is a graphite.wsgi.example
        # file in this directory that you can safely use, just copy it to graphite.wgsi
        WSGIScriptAlias / /home/stats/app/graphite/conf/graphite.wsgi 

        Alias /content/ /home/stats/app/graphite/webapp/content/
        <Location "/content/">
                SetHandler None
        </Location>

        Alias /grafana /home/stats/app/graphite/webapp/grafana

        # XXX In order for the django admin site media to work you
        # must change @DJANGO_ROOT@ to be the path to your django
        # installation, which is probably something like:
        # /usr/lib/python2.6/site-packages/django
        Alias /media/ "/home/Python-2.7.3/lib/python2.7/site-packages/django/contrib/admin/media/"
        <Location "/media/">
                SetHandler None
        </Location>
        # The graphite.wsgi file has to be accessible by apache. It won't
        # be visible to clients because of the DocumentRoot though.
        <Directory /home/stats/app/graphite/conf/>
                Order deny,allow
                Allow from all
        </Directory>

 </VirtualHost>

------------------------------------------------------------------------------------------------------------------------------------------------------------
ImportError at /dashboard

/home/Python-2.7.3/lib/python2.7/site-packages/cairo/_cairo.so: undefined symbol: cairo_surface_get_fallback_resolution

Request Method: 	GET
Request URL: 	http://graphite-host.domain.com:8990/dashboard
Django Version: 	1.6.2
Exception Type: 	ImportError
Exception Value: 	

/home/Python-2.7.3/lib/python2.7/site-packages/cairo/_cairo.so: undefined symbol: cairo_surface_get_fallback_resolution

Exception Location: 	/home/Python-2.7.3/lib/python2.7/site-packages/cairo/__init__.py in <module>, line 1
Python Executable: 	/home/Python-2.7.3/bin/python
Python Version: 	2.7.3
Python Path: 	

['/home/stats/app/graphite/webapp',
 '/home/Python-2.7.3/lib/python2.7/site-packages/setuptools-3.4.4dev-py2.7.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/Twisted-13.2.0-py2.7-linux-x86_64.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/python_memcached-1.53-py2.7.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/txAMQP-0.3-py2.7.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/daemonize-2.2.1-py2.7.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/psutil-2.1.0-py2.7-linux-x86_64.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/redis-2.9.1-py2.7.egg',
 '/home/Python-2.7.3/lib/python2.7/site-packages/statsd-2.1.2-py2.7.egg',
 '/home/Python-2.7.3/lib/python27.zip',
 '/home/Python-2.7.3/lib/python2.7',
 '/home/Python-2.7.3/lib/python2.7/plat-linux2',
 '/home/Python-2.7.3/lib/python2.7/lib-tk',
 '/home/Python-2.7.3/lib/python2.7/lib-old',
 '/home/Python-2.7.3/lib/python2.7/lib-dynload',
 '/usr/local/bfadmin/.local/lib/python2.7/site-packages',
 '/home/Python-2.7.3/lib/python2.7/site-packages',
 '/home/stats/app/graphite/webapp/graphite/thirdparty']

Server time: 	Wed, 14 May 2014 11:52:17 -0400
------------------------------------------------------------------------------------------------------------------------------------------------------------
Environment:


Request Method: GET
Request URL: http://graphite-host.domain.com:8990/dashboard

Django Version: 1.6.2
Python Version: 2.7.3
Installed Applications:
('graphite.metrics',
 'graphite.render',
 'graphite.cli',
 'graphite.browser',
 'graphite.composer',
 'graphite.account',
 'graphite.dashboard',
 'graphite.whitelist',
 'graphite.events',
 'django.contrib.auth',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.contenttypes',
 'tagging')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  101.                 resolver_match = resolver.resolve(request.path_info)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  320.                     sub_match = pattern.resolve(new_path)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  320.                     sub_match = pattern.resolve(new_path)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  222.             return ResolverMatch(self.callback, args, kwargs, self.name)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/urlresolvers.py" in callback
  229.         self._callback = get_callable(self._callback_str)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/utils/functional.py" in wrapper
  32.         result = func(*args)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/core/urlresolvers.py" in get_callable
  96.             mod = import_module(mod_name)
File "/home/Python-2.7.3/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  40.         __import__(name)
File "/home/stats/app/graphite/webapp/graphite/dashboard/views.py" in <module>
  12. from graphite.render.views import renderView
File "/home/stats/app/graphite/webapp/graphite/render/views.py" in <module>
  36. from graphite.render.evaluator import evaluateTarget
File "/home/stats/app/graphite/webapp/graphite/render/evaluator.py" in <module>
  47. from graphite.render.functions import SeriesFunctions
File "/home/stats/app/graphite/webapp/graphite/render/functions.py" in <module>
  33.   from graphite.render.glyph import format_units
File "/home/stats/app/graphite/webapp/graphite/render/glyph.py" in <module>
  15. import os, cairo, math, itertools, re
File "/home/Python-2.7.3/lib/python2.7/site-packages/cairo/__init__.py" in <module>
  1. from _cairo import *

Exception Type: ImportError at /dashboard
Exception Value: /home/Python-2.7.3/lib/python2.7/site-packages/cairo/_cairo.so: undefined symbol: cairo_surface_get_fallback_resolution
------------------------------------------------------------------------------------------------------------------------------------------------------------
Paths setup in the .profile for apache user
LD_LIBRARY_PATH=/home/Python-2.7.3/lib/python2.7/site-packages:/home/Python-2.7.3/lib:
PATH=/bin:/home/Python-2.7.3/bin:/home/Python-2.7.3/lib/python2.7/site-packages/django/bin/:/usr/kerberos/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PKG_CONFIG_PATH=/home/Python-2.7.3/lib/pkgconfig:
PYTHON=/home/Python-2.7.3/python
------------------------------------------------------------------------------------------------------------------------------------------------------------

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.