1

I am beginner.I'm running a task in Celery and getting this strange error

maximum recursion depth exceeded while calling a Python object

You can check the full error in this pastebin

I don't quite understand because I haven't change anything and yesterday it was working fine. I ran the task without celery in the python interpreter and it runs fine. You can check the function here. Finally, for what it is worth, this task is getting created 12 times by an other task.

Do you see anything that could create such an error?

EDIT:

This is the task I call this function / task

@celery.task(ignore_result=True)
def get_classicdata(leagueid):
    print "getting team data for %s"%leagueid
    returned_data = {}
    for team in r.smembers('league:%s'%leagueid):
        data = scrapteam.delay(team,r.get('currentgw'))
        returned_data[team] = data.get()
4
  • How and where do you call this function? Commented Nov 25, 2012 at 19:18
  • @alexvassel I have edited my question with the task where I call the function/task Commented Nov 25, 2012 at 19:29
  • i can not understand your code. What is r? And what returns r.smembers() and r.get() and what the heck is r)? Commented Nov 25, 2012 at 19:50
  • It's how I access to the redis DB. r.smembers('league:%s'%leagueid) return a set of IDs r.get('currentgw') return a int Commented Nov 25, 2012 at 19:52

1 Answer 1

2

Everything looks fine. The traceback implies that the returned object somewhere cannot be pickled, but your returned 'team' data structure is a dictionary containing a non-recursive data structure of basic types, so that can't cause a problem. For better remote debugging, please put a print statement before the "return team", so that it shows the content of the team. You might also try just having it return a {} and see if that changes thing.

Then also add a debugging print statement in get_classicdata showing the content of data.get(), as well as something just before the return there, in order to verify if that function reaches completion.

Sign up to request clarification or add additional context in comments.

2 Comments

For whatever reason, I added the print statements you recommended and it started to work again. I'm going to leave them there for a while, if the error comesback. Thx for the help!
One long-shot possibility: perhaps your network file system has screwy timestamps so the celery tasks were picking up an old .pyc file with buggy code, rather than the correct .py file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.