Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.

Asked by JARDINC

Hello,

I got an issue with the graphite installation.

When i try to start the httpd daemon i got theses messages in error.log :

[Thu Jul 31 11:24:26.894491 2014] [:error] [pid 18272:tid 140020414801728] /usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Thu Jul 31 11:24:26.896311 2014] [:error] [pid 18273:tid 140020414801728] /usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Thu Jul 31 11:24:26.898415 2014] [:error] [pid 18275:tid 140020414801728] /usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Thu Jul 31 11:24:26.899321 2014] [:error] [pid 18274:tid 140020414801728] /usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Thu Jul 31 11:24:26.899382 2014] [:error] [pid 18274:tid 140020414801728] "use STATIC_URL instead.", DeprecationWarning)
[Thu Jul 31 11:24:26.903214 2014] [:error] [pid 18271:tid 140020414801728] /usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Thu Jul 31 11:24:26.903271 2014] [:error] [pid 18271:tid 140020414801728] "use STATIC_URL instead.", DeprecationWarning)
[Thu Jul 31 11:24:26.903959 2014] [:error] [pid 18272:tid 140020414801728] "use STATIC_URL instead.", DeprecationWarning)
[Thu Jul 31 11:24:26.906903 2014] [:error] [pid 18273:tid 140020414801728] "use STATIC_URL instead.", DeprecationWarning)
[Thu Jul 31 11:24:26.909901 2014] [:error] [pid 18275:tid 140020414801728] "use STATIC_URL instead.", DeprecationWarning)
[Thu Jul 31 11:24:26.916218 2014] [:error] [pid 18274:tid 140020414801728] mod_wsgi (pid=18274): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Thu Jul 31 11:24:26.916257 2014] [:error] [pid 18274:tid 140020414801728] mod_wsgi (pid=18274): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Thu Jul 31 11:24:26.916294 2014] [:error] [pid 18274:tid 140020414801728] Traceback (most recent call last):
[Thu Jul 31 11:24:26.916338 2014] [:error] [pid 18274:tid 140020414801728] File "/opt/graphite/conf/graphite.wsgi", line 8, in <module>
[Thu Jul 31 11:24:26.916411 2014] [:error] [pid 18274:tid 140020414801728] import graphite.metrics.search
[Thu Jul 31 11:24:26.916446 2014] [:error] [pid 18274:tid 140020414801728] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Thu Jul 31 11:24:26.916530 2014] [:error] [pid 18274:tid 140020414801728] from graphite.storage import is_pattern, match_entries
[Thu Jul 31 11:24:26.916564 2014] [:error] [pid 18274:tid 140020414801728] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Thu Jul 31 11:24:26.916700 2014] [:error] [pid 18274:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.916744 2014] [:error] [pid 18274:tid 140020414801728] ImportError: No module named whisper
[Thu Jul 31 11:24:26.917960 2014] [:error] [pid 18272:tid 140020414801728] mod_wsgi (pid=18272): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Thu Jul 31 11:24:26.917996 2014] [:error] [pid 18272:tid 140020414801728] mod_wsgi (pid=18272): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Thu Jul 31 11:24:26.918032 2014] [:error] [pid 18272:tid 140020414801728] Traceback (most recent call last):
[Thu Jul 31 11:24:26.918076 2014] [:error] [pid 18272:tid 140020414801728] File "/opt/graphite/conf/graphite.wsgi", line 8, in <module>
[Thu Jul 31 11:24:26.918148 2014] [:error] [pid 18272:tid 140020414801728] import graphite.metrics.search
[Thu Jul 31 11:24:26.918182 2014] [:error] [pid 18272:tid 140020414801728] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Thu Jul 31 11:24:26.918267 2014] [:error] [pid 18272:tid 140020414801728] from graphite.storage import is_pattern, match_entries
[Thu Jul 31 11:24:26.918959 2014] [:error] [pid 18273:tid 140020414801728] mod_wsgi (pid=18273): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Thu Jul 31 11:24:26.918992 2014] [:error] [pid 18273:tid 140020414801728] mod_wsgi (pid=18273): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Thu Jul 31 11:24:26.919028 2014] [:error] [pid 18273:tid 140020414801728] Traceback (most recent call last):
[Thu Jul 31 11:24:26.919070 2014] [:error] [pid 18273:tid 140020414801728] File "/opt/graphite/conf/graphite.wsgi", line 8, in <module>
[Thu Jul 31 11:24:26.919139 2014] [:error] [pid 18273:tid 140020414801728] import graphite.metrics.search
[Thu Jul 31 11:24:26.919181 2014] [:error] [pid 18273:tid 140020414801728] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Thu Jul 31 11:24:26.919266 2014] [:error] [pid 18273:tid 140020414801728] from graphite.storage import is_pattern, match_entries
[Thu Jul 31 11:24:26.919301 2014] [:error] [pid 18273:tid 140020414801728] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Thu Jul 31 11:24:26.919435 2014] [:error] [pid 18273:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.919480 2014] [:error] [pid 18273:tid 140020414801728] ImportError: No module named whisper
[Thu Jul 31 11:24:26.920734 2014] [:error] [pid 18271:tid 140020414801728] mod_wsgi (pid=18271): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Thu Jul 31 11:24:26.920769 2014] [:error] [pid 18271:tid 140020414801728] mod_wsgi (pid=18271): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Thu Jul 31 11:24:26.920803 2014] [:error] [pid 18271:tid 140020414801728] Traceback (most recent call last):
[Thu Jul 31 11:24:26.920846 2014] [:error] [pid 18271:tid 140020414801728] File "/opt/graphite/conf/graphite.wsgi", line 8, in <module>
[Thu Jul 31 11:24:26.920989 2014] [:error] [pid 18271:tid 140020414801728] import graphite.metrics.search
[Thu Jul 31 11:24:26.921027 2014] [:error] [pid 18271:tid 140020414801728] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Thu Jul 31 11:24:26.921111 2014] [:error] [pid 18271:tid 140020414801728] from graphite.storage import is_pattern, match_entries
[Thu Jul 31 11:24:26.921146 2014] [:error] [pid 18271:tid 140020414801728] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Thu Jul 31 11:24:26.921281 2014] [:error] [pid 18271:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.922070 2014] [:error] [pid 18275:tid 140020414801728] mod_wsgi (pid=18275): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Thu Jul 31 11:24:26.922105 2014] [:error] [pid 18275:tid 140020414801728] mod_wsgi (pid=18275): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Thu Jul 31 11:24:26.922142 2014] [:error] [pid 18275:tid 140020414801728] Traceback (most recent call last):
[Thu Jul 31 11:24:26.922186 2014] [:error] [pid 18275:tid 140020414801728] File "/opt/graphite/conf/graphite.wsgi", line 8, in <module>
[Thu Jul 31 11:24:26.922256 2014] [:error] [pid 18275:tid 140020414801728] import graphite.metrics.search
[Thu Jul 31 11:24:26.922290 2014] [:error] [pid 18275:tid 140020414801728] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Thu Jul 31 11:24:26.922372 2014] [:error] [pid 18275:tid 140020414801728] from graphite.storage import is_pattern, match_entries
[Thu Jul 31 11:24:26.922406 2014] [:error] [pid 18275:tid 140020414801728] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Thu Jul 31 11:24:26.922553 2014] [:error] [pid 18275:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.922616 2014] [:error] [pid 18275:tid 140020414801728] ImportError: No module named whisper
[Thu Jul 31 11:24:26.923086 2014] [:error] [pid 18272:tid 140020414801728] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Thu Jul 31 11:24:26.923239 2014] [:error] [pid 18272:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.923284 2014] [:error] [pid 18272:tid 140020414801728] ImportError: No module named whisper
[Thu Jul 31 11:24:26.923603 2014] [:error] [pid 18271:tid 140020414801728] ImportError: No module named whisper

We have this message from the browser : 500 Internal Server Error

daemon is the user of apache. I already searched and found 2 topics but useless for my issue :

Rights/owner seems correct :

[root@p1graphite01 opt]# ls -haltr /opt/
total 20K
drwxr-xr-x. 5 root root 4,0K 22 juil. 19:08 .
drwxr-xr-x 8 daemon daemon 4,0K 22 juil. 19:08 graphite

Selinux is disabled.

I hope someone will be able to help me :)

Thanks

CJARD

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
JARDINC
Solved:
Last query:
Last reply:
Revision history for this message
Anatoliy Dobrosynets (anatolijd) said :
#1

CJARD,

[Thu Jul 31 11:24:26.916700 2014] [:error] [pid 18274:tid 140020414801728] import whisper
[Thu Jul 31 11:24:26.916744 2014] [:error] [pid 18274:tid 140020414801728] ImportError: No module named whisper

it can't find 'whisper' Python module - check if you've got it installed, as well as 'carbon' module.

Revision history for this message
JARDINC (cedric-jardin) said :
#2

Hi Anatoliy

I already did that :

[root@MYSERV sources]# pip install carbon
Downloading/unpacking carbon
  Running setup.py egg_info for package carbon
    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
    warning: no previously-included files found matching 'conf/*.conf'
Requirement already satisfied (use --upgrade to upgrade): twisted in /usr/lib64/python2.6/site-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): txamqp in /usr/lib/python2.6/site-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in /usr/lib64/python2.6/site-packages (from twisted->carbon)
Requirement already satisfied (use --upgrade to upgrade): distribute in /usr/lib/python2.6/site-packages (from zope.interface>=3.6.0->twisted->carbon)
Installing collected packages: carbon
  Running setup.py install for carbon
    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
    warning: no previously-included files found matching 'conf/*.conf'
    changing mode of /opt/graphite/bin/validate-storage-schemas.py to 755
    changing mode of /opt/graphite/bin/carbon-aggregator.py to 755
    changing mode of /opt/graphite/bin/carbon-relay.py to 755
    changing mode of /opt/graphite/bin/carbon-client.py to 755
    changing mode of /opt/graphite/bin/carbon-cache.py to 755
Successfully installed carbon
Cleaning up...
[root@MYSERV sources]# pip install whisper
Requirement already satisfied (use --upgrade to upgrade): whisper in /usr/lib/python2.6/site-packages
Cleaning up...

I don't know why it can't be found.

Revision history for this message
JARDINC (cedric-jardin) said :
#3

Hello, for informations, here is my list of installed modules =>

[root@MYSERV /]# pip list
Conch (8.2.0)
distribute (0.6.10)
Django (1.4.13)
django-tagging (0.3.1)
fpconst (0.7.3)
iniparse (0.3.1)
pycrypto (2.0.1)
pycurl (7.19.0)
pygpgme (0.1)
pyOpenSSL (0.10)
pysqlite (2.3.5)
python-ldap (2.3.10)
python-memcached (1.43)
PyXML (0.8.4)
simplejson (2.0.9)
SOAPpy (0.11.6)
Twisted (14.0.0)
Twisted-Core (8.2.0)
Twisted-Lore (8.2.0)
Twisted-Mail (8.2.0)
Twisted-Names (8.2.0)
Twisted-News (8.2.0)
Twisted-Runner (8.2.0)
Twisted-Web (8.2.0)
Twisted-Words (8.2.0)
txAMQP (0.6.2)
urlgrabber (3.9.1)
whisper (0.9.12)
yum-metadata-parser (1.1.2)
zope.interface (4.1.1)

I Still have the error message :

[Fri Aug 01 08:36:44.233510 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] mod_wsgi (pid=7921): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Fri Aug 01 08:36:44.233705 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] mod_wsgi (pid=7921): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Fri Aug 01 08:36:44.233821 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] Traceback (most recent call last):
[Fri Aug 01 08:36:44.233916 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] File "/opt/graphite/conf/graphite.wsgi", line 16, in <module>
[Fri Aug 01 08:36:44.234030 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] import graphite.metrics.search
[Fri Aug 01 08:36:44.234409 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
[Fri Aug 01 08:36:44.234517 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] from graphite.storage import is_pattern, match_entries
[Fri Aug 01 08:36:44.234582 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] File "/opt/graphite/webapp/graphite/storage.py", line 4, in <module>
[Fri Aug 01 08:36:44.234681 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] import whisper
[Fri Aug 01 08:36:44.234812 2014] [:error] [pid 7921:tid 140214909404928] [client 128.1.11.150:76] ImportError: No module named whisper

I hope that someone will have a clue/anwser for me .

BR

CJARD

Revision history for this message
JARDINC (cedric-jardin) said :
#4

So ... I found that in /usr/lib/python2.6/site-packages/ my whisper.py & .pyc files were in 600 and not in 644

-rw------- 1 root root 27K 1 août 12:03 whisper.py
-rw------- 1 root root 24K 1 août 12:03 whisper.pyc

TO

-rw-r--r-- 1 root root 27K 1 août 12:03 whisper.py
-rw-r--r-- 1 root root 24K 1 août 12:03 whisper.pyc

Now i got the web interface !

I always have other messages in the error.log but i will try to debug them bymyself ! :)

I hope it can help someone :) ++