I am trying to debug a celery task but the parameters and local variables aren't present when I telnet in:
from celery import Celery
from celery.contrib import rdb
celery = Celery('tasks', broker="redis://localhost:6379/0")
@celery.task
def add(x, y):
someVar = 3
rdb.set_trace()
In a different terminal:
telnet 127.0.0.1 6902 (or whatever the port number is)
x, y and someVar will all produce a name error like: NameError: name 'x' is not defined
To check if you are in the current stack frame, use the u and d (up and down) to move up and down (http://docs.python.org/2/library/pdb.html#debugger-commands)
You can see which file you're in (it's written in the pdb prompt). Usually you have to go up once or twice to get to the right file, from what I've experienced
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With