Graphs are not rendering

Asked by opene2 on 2016-08-02

After the initial setup, I am seeing broken image in the graph. Following are environment details.

Server OS: CentOS 6.7 64bit
Graphite: 0.9.10
Python: 2.7.12
Django: 1.9.8

# Debug info

AttributeError at /render/

'WSGIRequest' object has no attribute 'REQUEST'

Request Method: GET
Request URL: http://<graphite-server>/render/?width=586&height=308&_salt=1470159231.942
Django Version: 1.9.8
Exception Type: AttributeError
Exception Value: 'WSGIRequest' object has no attribute 'REQUEST'
Exception Location: /opt/graphite/webapp/graphite/render/views.py in parseOptions, line 236
Python Executable: /usr/bin/python
Python Version: 2.7.12
Python Path:
['/opt/graphite/webapp',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages/setuptools-25.1.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/pytz-2016.6.1-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/python_memcached-1.54-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/six-1.10.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/python_ldap-2.4.26-py2.7-linux-x86_64.egg',
 '/usr/local/lib/python2.7/site-packages/txAMQP-0.3-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages/Twisted-16.3.0-py2.7-linux-x86_64.egg',
 '/usr/local/lib/python2.7/site-packages/zope.interface-4.2.0-py2.7-linux-x86_64.egg',
 '/usr/local/lib/python2.7/site-packages/whitenoise-3.2-py2.7.egg',
 '/opt/graphite/webapp',
 '/opt/graphite/webapp/graphite/thirdparty']

Environment:

Request Method: GET
Request URL: http://<graphite-server>/render/?width=586&height=308&_salt=1470159231.942

Django Version: 1.9.8
Python Version: 2.7.12
Installed Applications:
('graphite.metrics',
 'graphite.render',
 'graphite.cli',
 'graphite.browser',
 'graphite.composer',
 'graphite.account',
 'graphite.dashboard',
 'graphite.whitelist',
 'graphite.events',
 'graphite.url_shortener',
 '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 "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/graphite/webapp/graphite/render/views.py" in renderView
  56. (graphOptions, requestOptions) = parseOptions(request)

File "/opt/graphite/webapp/graphite/render/views.py" in parseOptions
  236. queryParams = request.REQUEST

Exception Type: AttributeError at /render/
Exception Value: 'WSGIRequest' object has no attribute 'REQUEST'

# error.log
[Tue Aug 02 10:46:13 2016] [error] Internal Server Error: /browser/usergraph/
[Tue Aug 02 10:46:13 2016] [error] Traceback (most recent call last):
[Tue Aug 02 10:46:13 2016] [error] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
[Tue Aug 02 10:46:13 2016] [error] response = self.process_exception_by_middleware(e, request)
[Tue Aug 02 10:46:13 2016] [error] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
[Tue Aug 02 10:46:13 2016] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Tue Aug 02 10:46:13 2016] [error] File "/opt/graphite/webapp/graphite/browser/views.py", line 250, in userGraphLookup
[Tue Aug 02 10:46:13 2016] [error] return json_response(nodes, request)
[Tue Aug 02 10:46:13 2016] [error] File "/opt/graphite/webapp/graphite/browser/views.py", line 255, in json_response
[Tue Aug 02 10:46:13 2016] [error] jsonp = request.REQUEST.get('jsonp', False)
[Tue Aug 02 10:46:13 2016] [error] AttributeError: 'WSGIRequest' object has no attribute 'REQUEST'

[Tue Aug 02 10:48:01 2016] [error] Internal Server Error: /render/
[Tue Aug 02 10:48:01 2016] [error] Traceback (most recent call last):
[Tue Aug 02 10:48:01 2016] [error] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
[Tue Aug 02 10:48:01 2016] [error] response = self.process_exception_by_middleware(e, request)
[Tue Aug 02 10:48:01 2016] [error] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
[Tue Aug 02 10:48:01 2016] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Tue Aug 02 10:48:01 2016] [error] File "/opt/graphite/webapp/graphite/render/views.py", line 56, in renderView
[Tue Aug 02 10:48:01 2016] [error] (graphOptions, requestOptions) = parseOptions(request)
[Tue Aug 02 10:48:01 2016] [error] File "/opt/graphite/webapp/graphite/render/views.py", line 236, in parseOptions
[Tue Aug 02 10:48:01 2016] [error] queryParams = request.REQUEST
[Tue Aug 02 10:48:01 2016] [error] AttributeError: 'WSGIRequest' object has no attribute 'REQUEST'

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Anatoliy Dobrosynets
Solved:
2016-08-03
Last query:
2016-08-03
Last reply:
2016-08-03
Jason Dixon (jason-dixongroup) said : #1

Looks like a problem with your WSGI setup. I honestly can't offer much advice given how ancient your version of Graphite is here (0.9.10).

Jason

opene2 (opene2) said : #2

Sorry, I mistyped the Graphite version. It is acutally 0.9.15.

> cat /opt/graphite/webapp/graphite_web-0.9.15-py2.7.egg-info/PKG-INFO
Metadata-Version: 1.0
Name: graphite-web
Version: 0.9.15

I am new to WSGI setup. Any pointers on where I should start looking?

Downgrade your django

WSGIRequest.REQUEST was removed in django 1.9:
https://docs.djangoproject.com/en/1.8/internals/deprecation/#deprecation-removed-in-1-9

opene2 (opene2) said : #4

Downgraded django to 1.8.14 and it worked.

Thanks for your hlep

opene2 (opene2) said : #5

Thanks Anatoliy Dobrosynets, that solved my question.