Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Sentry not logging unhandled exceptions from django

338 views
Skip to first unread message

Tom Evans

unread,
May 12, 2015, 9:37:32 AM5/12/15
to gets...@googlegroups.com
Hi all

I'm trying to improve our debugging experience in our django apps by adding sentry to track errors, but after configuring and rolling out to a couple of test servers, events that should be logged are only appearing from one of the servers. The servers have identical configuration, they are deployed from the same SVN commit.

We are using sentry 6.4.4, and raven 5.1.1 (as this is what was current when another team installed sentry last year), and unfortunately I cannot devote a lot of time to upgrade to the latest version. Ideally, I would show the benefit of having sentry logging our errors, and move to a paid getsentry subscription; I have no desire to maintain another project.

I configured a new project for the sample site, added raven.contrib.django.raven_compat to INSTALLED_APPS, added the DSN to the project's settings, and deployed this to two app servers. Going to a simple view that deliberately raises an exception results in an event being logged from app01, but from app02 nothing is ever logged. app01 and app02 have identical code, packages and configuration. Running "manage.py raven test" from either server results in an entry appearing in sentry.

Can anyone explain how this automagic handling of exceptions is occurring, how I can debug why it is not happening on app02, or what I can try next?

Cheers

Tom

David Cramer

unread,
May 12, 2015, 4:11:38 PM5/12/15
to gets...@googlegroups.com
Are you using:

- gunicorn? [if so how]
- gevent?
- another web server?

What version of Raven on the new app?

--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Evans

unread,
May 13, 2015, 5:02:20 AM5/13/15
to gets...@googlegroups.com
On Tue, May 12, 2015 at 9:11 PM, David Cramer <dcr...@gmail.com> wrote:
> Are you using:
>
> - gunicorn? [if so how]
> - gevent?
> - another web server?
>
> What version of Raven on the new app?

apache 2.2, mod_wsgi 3.2, python 2.6.6, all from CentOS 6 or EPEL.

mod_wsgi is configured as:

WSGIDaemonProcess app python-path=... processes=4 threads=15

raven 5.1.1, django 1.4 from pypi.

Cheers

Tom

David Cramer

unread,
May 13, 2015, 5:31:14 AM5/13/15
to gets...@googlegroups.com, gets...@googlegroups.com
Are you able to upgrade to the newest version of Raven? I don’t *think* we fixed anything beyond management commands, but we don’t throw everything into CHANGES either.

We hook into the “got_request_exception” signal, and by default use a worker thread to send events. That means that things could fail to send if a process dies, but is unlikely.



Tom Evans

unread,
May 13, 2015, 7:45:20 AM5/13/15
to gets...@googlegroups.com
On Wed, May 13, 2015 at 10:31 AM, David Cramer <dcr...@gmail.com> wrote:
> Are you able to upgrade to the newest version of Raven? I don’t *think* we
> fixed anything beyond management commands, but we don’t throw everything
> into CHANGES either.

raven-python
Raven is a standalone (and the official) Python client for Sentry.
This version of Raven requires Sentry 7.0 or newer.

We are using sentry 6.4.4. AFAICT - readthedocs only has documentation
for the latest version - 5.1.1 is the latest version of raven that
supports sentry 6.

>
> We hook into the “got_request_exception” signal, and by default use a worker
> thread to send events. That means that things could fail to send if a
> process dies, but is unlikely.

raven spawns a thread to deliver the event to sentry?

I cannot find any log files on the sentry server itself. Is there a
simple way to enable some logs to determine whether the request
reaches sentry, or is there logging that I can enable on the app
server to determine whether it attempts to deliver the event to
sentry?

Cheers

Tom

David Cramer

unread,
May 13, 2015, 5:47:21 PM5/13/15
to gets...@googlegroups.com, gets...@googlegroups.com
The log files would be both with the web process (it uses gunicorn, there should be some log settings you can specify) as well as the worker process (with -l INFO).



Reply all
Reply to author
Forward
0 new messages