Public bug reported:

It seems graphite-web package on Ubuntu 14.04 it's doing calls that are
deprecated from django 1.6:
https://docs.djangoproject.com/en/dev/internals/deprecation
/#deprecation-removed-in-1-6

The package depends on >> python-django1.6-1 so this call is not
correct.

The call can be found on ...views.py:45 :
        event = json.loads(request.raw_post_data)

To solve this error, the line has to be changed for:
        event = json.loads(request.body)
 
and it gives this error when, for example, doing a POST request to /events to 
add an event.
<body style="background-color: #666666; color: black;">
<center>
<h2 style='font-family: "Arial"'>
<p>Graphite encountered an unexpected error while handling your request.</p>
<p>Please contact your site administrator if the problem persists.</p>
</h2>
<br/>
<div style="width: 50%; text-align: center; font-family: monospace; 
background-color: black; font-weight: bold; color: #ff4422;">

</div>

<div style="width: 70%; text-align: left; background-color: black; color: 
#44ff22; border: thin solid gray;">
<pre>
Traceback (most recent call last):
  File 
&quot;/usr/lib/python2.7/dist-packages/django/core/handlers/base.py&quot;, line 
112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File &quot;/usr/lib/python2.7/dist-packages/graphite/events/views.py&quot;, 
line 33, in view_events
    return post_event(request)
  File &quot;/usr/lib/python2.7/dist-packages/graphite/events/views.py&quot;, 
line 45, in post_event
    event = json.loads(request.raw_post_data)
AttributeError: &#39;WSGIRequest&#39; object has no attribute 
&#39;raw_post_data&#39;

</pre>
</div>

</center>


Ubuntu version:
# lsb_release -rd
Description:    Ubuntu 14.04.3 LTS
Release:        14.04

Graphite-web version:
# apt-cache policy graphite-web
graphite-web:
  Installed: 0.9.12+debian-3
  Candidate: 0.9.12+debian-3
  Version table:
 *** 0.9.12+debian-3 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

Django version:
# apt-cache policy python-django
python-django:
  Installed: 1.6.1-2ubuntu0.11
  Candidate: 1.6.1-2ubuntu0.11
  Version table:
 *** 1.6.1-2ubuntu0.11 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 
Packages
        100 /var/lib/dpkg/status
     1.6.1-2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages


Attached there is the diff file to solve it.

Cheers.

** Affects: graphite-web (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "graphite-web.patch"
   
https://bugs.launchpad.net/bugs/1523615/+attachment/4531069/+files/graphite-web.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1523615

Title:
  graphite-web calling django request.raw_post_data that is deprecated

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/graphite-web/+bug/1523615/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to