Excetion loading graphite.wsgi

Asked by Ralph

Hi to all,

I am despairing!

I try to install graphite (0.9.14 due to python version 2.6)in on RHEL 6.7. I did all necessary step during installation (I believe that I did it). If I start appache or call http://hostname:8080 I'm still getting this error:

AttributeError: 'NoneType' object has no attribute 'find'
 mod_wsgi (pid=2809): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=2809): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=2809): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
Traceback (most recent call last):
File "/opt/graphite/conf/graphite.wsgi", line 31, in <module>
 application = DjangoWhiteNoise(application)
File "/usr/lib/python2.6/site-packages/whitenoise/django.py", line 46, in __init__
self.configure_from_settings(settings)
File "/usr/lib/python2.6/site-packages/whitenoise/django.py", line 68, in configure_from_settings
getattr(settings, 'STATIC_URL', ''))
File "/usr/lib/python2.6/site-packages/whitenoise/django.py", line 36, in get_prefix_from_url
return format_prefix(urlparse.urlparse(url).path)
File "/usr/lib64/python2.6/urlparse.py", line 132, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib64/python2.6/urlparse.py", line 171, in urlsplit
i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'

I have running test box with RHEL 6.5 and graphite 0.9.13. with an identical configuration.

Any suggestions?

graphite.wsgi:
Listen 8080

<IfModule !wsgi_module.c>
    LoadModule wsgi_module modules/mod_wsgi.so
</IfModule>

# XXX You need to set this up!
# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
WSGISocketPrefix run/wsgi

<VirtualHost *:8080>
        ServerName my.server.net
        DocumentRoot "/opt/graphite/webapp"
        ErrorLog /var/log/graphite-web/error.log
        CustomLog /var/log/graphite-web/access.log common

        # 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 /opt/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 / /opt/graphite/conf/graphite.wsgi

        Alias /content/ /opt/graphite/webapp/content/
        <Location "/content/">
                SetHandler None
        </Location>

        # 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/ "@DJANGO_ROOT@/contrib/admin/media/"
        Alias /media/ "/usr/lib/python2.6/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 /opt/graphite/conf/>
                Order deny,allow
                Allow from all
        </Directory>

</VirtualHost>

Regards
Ralph

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jason Dixon (jason-dixongroup) said :
#1

If you can't or won't upgrade to 0.9.15, you'll need to patch your installation with this fix.

https://github.com/graphite-project/graphite-web/commit/4028dc504c586fb8e38ad24b3ca35b1a66fe1619

You can see all of the post-0.9.14 changes here:

https://github.com/graphite-project/graphite-web/compare/0.9.14...0.9.15

Revision history for this message
Ralph (ralph-breier) said :
#2

Thanks for the quick anzwer.

I added the line in graphite.wsgi, but the problem still remains.

Graphite 0.9.15 requires python 2.7. I tried this and got more probs (due to follow up dependencies), so I returned to the distribution standard.

Revision history for this message
Jason Dixon (jason-dixongroup) said :
#3

Did you actually restart the web application after applying the patch?

Revision history for this message
Ralph (ralph-breier) said :
#4

Yes, I did.

Revision history for this message
Ralph (ralph-breier) said :
#5

I'm wondering, why DjangoWhiteNoise try to get a url prefix.

Revision history for this message
rocky (rocky.munich1) said :
#6

Hi All,

Is this issue resolved ?
could you please share the details.

Can you help with this problem?

Provide an answer of your own, or ask Ralph for more information if necessary.

To post a message you must log in.