question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible with celery==3.1.6 ?

See original GitHub issue
[2013-12-05 06:21:09,123: CRITICAL/MainProcess] Task task.sync_note[48e9a697-fc04-4dc8-b248-4cd524bd305e] INTERNAL ERROR: AttributeError("'Celery' object has no attribute 'captureException'",)
Traceback (most recent call last):
  File "/home/dreampuf/www/tblog/.py/lib/python2.7/site-packages/celery/app/trace.py", line 235, in trace_task
    R = I.handle_error_state(task, eager=eager)
  File "/home/dreampuf/www/tblog/.py/lib/python2.7/site-packages/celery/app/trace.py", line 84, in handle_error_state
    }[self.state](task, store_errors=store_errors)
  File "/home/dreampuf/www/tblog/.py/lib/python2.7/site-packages/celery/app/trace.py", line 124, in handle_failure
    einfo=einfo)
  File "/home/dreampuf/www/tblog/.py/lib/python2.7/site-packages/celery/utils/dispatch/signal.py", line 150, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/dreampuf/www/tblog/.py/lib/python2.7/site-packages/raven/contrib/celery/__init__.py", line 47, in process_failure_signal
    client.captureException(
AttributeError: 'Celery' object has no attribute 'captureException'

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
galonskycommented, Aug 9, 2018

@GVRV I did something like this below (@baratrion’s idea):

def add_sentry_handler_to_task_loggers(client, loglevel=logging.ERROR):
    """
    Similar to what raven's `register_logger_signal` does, but registers
    the celery `after_setup_task_logger` to add the SentryHandler to all
    celery task loggers (register_logger_signal only registers the signal
    to configure global loggers)
    """
    filter_ = CeleryFilter()

    handler = SentryHandler(client)
    handler.setLevel(loglevel)
    handler.addFilter(filter_)
    handler.setFormatter(TaskFormatter())

    def process_logger_event(
        sender, logger, loglevel, logfile, format, colorize, **kwargs
    ):
        logger.addHandler(handler)

    # See http://docs.celeryproject.org/en/latest/userguide/signals.html#after-setup-task-logger
    after_setup_task_logger.connect(process_logger_event, weak=False)
0reactions
GVRVcommented, Aug 10, 2018

@galonsky That works beautifully! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change history — Celery 3.1.25 documentation
This must be enabled manually as it's incompatible with workers and clients not using it, so be sure to enable the option in...
Read more >
celery · PyPI
Celery communicates via messages, usually using a broker to mediate between clients ... In addition to Python there's node-celery for Node.js, a PHP...
Read more >
Celery and transaction.atomic - django - Stack Overflow
Is there some incompatibility between transaction.atomic and celery? Is it possible in Django 1.6 or 1.7 for me to have both regular model ......
Read more >
Celery Documentation - Read the Docs
Celery is a simple, flexible and reliable distributed system to process vast amounts of messages, while providing.
Read more >
What's new in Celery 3.0 (Chiastic Slide)
If you use Celery in combination with Django you must also read the ... This means that ETA/countdown in messages are not compatible...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found