dcramer/django-sentry — Issue #256: error when logging empty post
Author: Andrey86
Created: 2011-10-21 15:49:14+00:00
State: open

Error occurs when sentry tries to log exception happend after empty POST request.

Unable to process log entry: You cannot access raw_post_data after reading from request's data stream
Traceback (most recent call last):
File ".../lib/python2.6/site-packages/raven/contrib/django/models.py", line 97, in actually_do_stuff
get_client().create_from_exception(**extra)
File ".../lib/python2.6/site-packages/raven/contrib/django/__init__.py", line 120, in create_from_exception
return super(DjangoClient, self).create_from_exception(exc_info, **kwargs)
File ".../lib/python2.6/site-packages/raven/base.py", line 304, in create_from_exception
**kwargs
File ".../lib/python2.6/site-packages/raven/contrib/django/__init__.py", line 30, in process
if not request.POST and request.raw_post_data:
File ".../lib/python2.6/site-packages/django/http/__init__.py", line 240, in _get_raw_post_data
raise Exception("You cannot access raw_post_data after reading from request's data stream")

I'm using separate sentry server with uwsgi & apache. Worked fine before I upgraded from 1.6 to 1.13.