Repository navigation
Closed
Description
Hello,
This is my tasks.py:
from celery import Celery
from celery.exceptions import Reject
app = Celery('test')
@app.task(bind=True)
def cmd(self):
raise Reject('test')Calling cmd task results in this:
[2014-05-16 22:29:20,984: INFO/MainProcess] Received task: tasks.cmd[8faef228-de76-481a-bab5-3cde93cd7adb]
[2014-05-16 22:29:20,992: WARNING/MainProcess] Traceback (most recent call last):
[2014-05-16 22:29:20,993: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/logging/__init__.py", line 939, in emit
[2014-05-16 22:29:20,995: WARNING/MainProcess] msg = self.format(record)
[2014-05-16 22:29:20,998: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/logging/__init__.py", line 810, in format
[2014-05-16 22:29:20,999: WARNING/MainProcess] return fmt.format(record)
[2014-05-16 22:29:20,999: WARNING/MainProcess] File "/home/dmitry/.virtualenvs/venv_caster/lib/python3.3/site-packages/celery/utils/log.py", line 138, in format
[2014-05-16 22:29:21,000: WARNING/MainProcess] msg = logging.Formatter.format(self, record)
[2014-05-16 22:29:21,001: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/logging/__init__.py", line 556, in format
[2014-05-16 22:29:21,001: WARNING/MainProcess] record.exc_text = self.formatException(record.exc_info)
[2014-05-16 22:29:21,002: WARNING/MainProcess] File "/home/dmitry/.virtualenvs/venv_caster/lib/python3.3/site-packages/celery/utils/log.py", line 132, in formatException
[2014-05-16 22:29:21,002: WARNING/MainProcess] r = logging.Formatter.formatException(self, ei)
[2014-05-16 22:29:21,003: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/logging/__init__.py", line 506, in formatException
[2014-05-16 22:29:21,004: WARNING/MainProcess] traceback.print_exception(ei[0], ei[1], tb, None, sio)
[2014-05-16 22:29:21,004: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/traceback.py", line 156, in print_exception
[2014-05-16 22:29:21,005: WARNING/MainProcess] for value, tb in values:
[2014-05-16 22:29:21,006: WARNING/MainProcess] File "/home/dmitry/.pyenv/versions/3.3.4/lib/python3.3/traceback.py", line 122, in _iter_chain
[2014-05-16 22:29:21,007: WARNING/MainProcess] context = exc.__context__
[2014-05-16 22:29:21,007: WARNING/MainProcess] AttributeError: 'NoneType' object has no attribute '__context__'
[2014-05-16 22:29:21,009: WARNING/MainProcess] Logged from file log.py, line 278
Bugreport is attached:
software -> celery:3.1.11 (Cipater) kombu:3.0.15 py:3.3.4
billiard:3.3.0.17 py-amqp:1.4.5
platform -> system:Linux arch:64bit, ELF imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:disabled
Activity
ask commentedon May 19, 2014
Works for me, not sure what the traceback means, looks like a bug in logging maybe
malinoff commentedon May 19, 2014
@ask A little investigation shows that the problem is located here: celery/app/trace.py#L243
Somehow instead of
ExceptionType, Exception, Tracebacklogger receivesNone, None, NoneJocelynDelalande commentedon Sep 16, 2014
I can confirm the bug with Py3.2,
Reproduced also with:
Available for more debug information.
JocelynDelalande commentedon Sep 16, 2014
Was fixed (by side-effect of a refacto) in e442df6, though,
If you need to use a stable version (which is my case), here is a monkey-patch (should work on 3.1.x), put it in a file (eg: monkey_patch.py) you import early in your code.
Fixes einfo in log for Reject. Closes #2043
ask commentedon Oct 8, 2014
Thanks for the fix, applied in 3.1 branch!
Released Celery version 3.1.27+eventbrite
Released Celery version 3.1.27+eventbrite (#6)