dcramer/raven — Issue #40: Celery issues
Author: 23doors
Created: 2012-01-22 23:48:59+00:00
State: open

I am having issues with celery - sentry integration.
Everything was working some time ago but after some update (not sure what exactly changed - sentry or celery) things started to go down. Right now, every time exception occurs I get:

Exception with traceback in logfile which is not logged in with sentry +

```
WARNING 2012-01-23 00:39:21,499 celery: Top level Sentry exception caught - failed creating log record
WARNING 2012-01-23 00:39:21,499 celery: Task %(name)s[%(id)s] raised exception: %(exc)s
%(traceback)s
WARNING 2012-01-23 00:39:21,501 celery: Traceback (most recent call last):
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/client/handlers.py", line 31, in emit
get_client().create_from_record(record, request=request)
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/client/base.py", line 308, in create_from_record
return self.create_from_exception(record.exc_info, **kwargs)
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/client/base.py", line 358, in create_from_exception
frames = varmap(shorten, get_stack_info(iter_traceback_frames(exc_traceback)))
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/utils/stacks.py", line 118, in get_stack_info
for frame in frames:
File "/opt/local/srv/python-environments/hydra/lib/python2.7/site-packages/sentry/utils/stacks.py", line 108, in iter_traceback_frames
if not tb.tb_frame.f_locals.get('__traceback_hide__'):
AttributeError: '_Frame' object has no attribute 'f_locals'
```

which gets logged instead (well, not really helpful to say the least). Using sentry with logging config (disable existing), handler:

'sentry': {
'level': 'WARNING',
'class': 'sentry.client.handlers.SentryHandler',
'formatter': 'verbose'
},