graphite-web returns Internal Server Error due to incompatible changes in Django

Bug #1460709 reported by Özgür Caner
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
graphite-web (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Querying data from a graphite-web instance results in 500 Internal Server Error caused by incompatible changes in Django framework, see error output below. It seems that the mimetype argument was renamed to content_type in Django HttpResponse.

Applying the attached patch seems to fix the mentioned issue.

TypeError at /metrics/index.json
__init__() got an unexpected keyword argument 'mimetype'
Request Method: GET
Request URL: https://XXXX/metrics/index.json
Django Version: 1.7.6
Exception Type: TypeError
Exception Value:
__init__() got an unexpected keyword argument 'mimetype'
Exception Location: /usr/lib/python2.7/dist-packages/django/http/response.py in __init__, line 318
Python Executable: /usr/bin/uwsgi-core
Python Version: 2.7.6
Python Path:
['/usr/lib/python2.7/dist-packages',
 '/etc/graphite/',
 '.',
 '',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/pymodules/python2.7',
 '/etc/graphite',
 '/usr/lib/python2.7/dist-packages/graphite/thirdparty']
Server time: Mon, 1 Jun 2015 08:53:19 -0500

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: graphite-web 0.9.12+debian-3
ProcVersionSignature: Ubuntu 3.13.0-53.89-generic 3.13.11-ckt19
Uname: Linux 3.13.0-53-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
Date: Mon Jun 1 17:34:20 2015
PackageArchitecture: all
SourcePackage: graphite-web
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.graphite.local.settings.py: 2015-05-28T22:24:55.024571

Revision history for this message
Özgür Caner (oc-b) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "A patch to fix the issue" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in graphite-web (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Leinen (simon-leinen) wrote :

Yes, this broke my Graphite installation on Trusty when Django was upgraded to 1.7 as part of an OpenStack upgrade to Kilo from the Ubuntu Cloud Archive. The patch looks good, I applied something very similar by hand. This and something similar to https://github.com/graphite-project/graphite-web/commit/07956bc0841f2aa24ad9b07de3d90184d4cb7c42 fixed the issue for me.

Revision history for this message
Filip Pytloun (fpytloun) wrote :

Hello,

this bug (incompatibility of graphite-web with django 1.8 and newer) also affects current graphite-web (0.9.15+debian-1) in Xenial, making it unusable.

Fortunately this was fixed in newer revision (0.9.15+debian-2) of graphite-web, available in Debian unstable:

graphite-web (0.9.15+debian-2) unstable; urgency=medium

  [ Mathieu Parent ]
  * Remove me from uploaders

  [ Jonas Genannt ]
  * d/README: change to migrate (Closes: #824230)
  * d/README: added chown for sqlite usage (Closes: #811389)
  * Added backported patch for Django 1.9 (Closes: #824962)
  * d/control:
    - bumped standards version
    - changed to secure Vcs URLs

 -- Jonas Genannt <email address hidden> Sun, 22 May 2016 15:32:51 +0200

Someone should backport this patch or whole package from current Debian unstable into Xenial to make it work again.

Revision history for this message
Jonas Genannt (hggh) wrote :

I have uploaded Graphite 1.0.2 into a PPA for Xenial: https://launchpad.net/~hggh/+archive/ubuntu/graphite

Revision history for this message
niol (alexandre-rossi) wrote :

Fixed in 1.0.2+debian-2.1

Changed in graphite-web (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.