Celery exceptions create two events

65 views
Skip to first unread message

jsm...@hubspot.com

unread,
May 6, 2013, 6:29:37 PM5/6/13
to gets...@googlegroups.com
I've got Sentry logging working great with my Django project but I've having an odd problem with reporting errors from inside Celery tasks.

I'm getting two events for every exception logged, one from celery.worker.log and one from the root logger. The one from the root logger doesn't have any of the log-related "additional data" that the one from celery.worker.log has (like message, pathname, filename, etc).

As far I know, I'm not using the error-line reporting stuff, just the exception reporting stuff. Can anyone tell which config bits have I missed?

Here's the task:

@task
def raise_celery_task_exception():
    raise Exception("Testing exception reporting from Celery")


I'm running celery with "manage.py celery worker -B --loglevel=INFO"

Here's the relevant parts of my settings.py:

INSTALLED_APPS = (
    ...
    'djcelery',
    'raven.contrib.django.celery',
    'raven.contrib.django.raven_compat',
    ...
)

RAVEN_CONFIG = {
     'dsn': REMOVED
}

CELERY_IGNORE_RESULT = True
CELERY_DISABLE_RATE_LIMITS = True

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'verbose': {
            'format': '%(levelname) -8s %(asctime)s [%(name)s %(funcName)s:%(lineno)s] %(message)s',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        },
    },
    'loggers': {
        'celery': {
            'level': 'WARNING',
        },
    },
    'root': {
        'level': 'INFO',
        'handlers': ['console']
    }
}

David Cramer

unread,
May 6, 2013, 6:40:01 PM5/6/13
to gets...@googlegroups.com
Is this the latest version of raven-python or perhaps older? We changed some stuff at one point to better work with Celery.
--
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/groups/opt_out.
 
 

jsm...@hubspot.com

unread,
May 6, 2013, 6:49:37 PM5/6/13
to gets...@googlegroups.com
That was it. I was running 3.1 - my setup.py had 3.3.6 but I hadn't updated my virtualenv since adding it, so I was using the version provided by another package.

Thanks for your help!
Reply all
Reply to author
Forward
0 new messages