1

I am a new hire at a company that is using Django with Celery for asynchronous communication. I am new to Celery as well.

The previous programmer left a Celery task defined which is obsolete. Every 30 seconds it performs some database retrievals, does a bunch of logic, and then throws the results away. This was apparently a dead end, a different system was completed later on which does what this was actually meant to do.

I have removed the task definition from the python source file it was found in, and also removed the following section from our settings.py file:

CELERYBEAT_SCHEDULE = {
    "runs-every-30-seconds": {
        "task": "foo.tasks.execute_useless_task",
        "schedule": timedelta(seconds=30),
    },
}

The problem is that Celery is still trying to execute it whenever I start up django and Celery through supervisor. From /var/log/supervisor/celeryd-stdout---supervisor-FZ2Xqo.log (lines truncated for brevity):

ERROR 2014-11-20 15:26:35,637 base+498 Failed to submit message: u'Unknown task ignored: Task of kind \'foo.tasks.execute_useless_task\' is not registered, please make sure it\'s imported...
ERROR 2014-11-20 15:26:35,751 base+504 Unknown task ignored: Task of kind 'foo.tasks.execute_useless_task' is not registered, please make sure it's imported...
ERROR 2014-11-20 15:26:35,764 base+504 Unknown task ignored: Task of kind 'foo.tasks.execute_useless_task' is not registered, please make sure it's imported...
...and so on...

I have been trying to read through the celery docs all day to find out exactly how celery could know about the task, now that I've removed all trace of it from our codebase (while being pulled in 50 different directions at once, being a developer, admin, and technical support desk all at the same time, naturally). Most of the documentation or discussion I have found is around a FAILURE to execute tasks, and reversing the directions I have found around that has lead nowhere.

If anyone could direct me to some documentation that specifies exactly all the ways that one can register tasks with celery through Django, so that I can figure out how the heck celery could possibly know that task existed, I would appreciate it.

Rjak
  • 2,097
  • 4
  • 19
  • 24

1 Answers1

1

Answered my own question.

I had expected the message queue to be empty, but it was not. Clearing out redis fixed the problem for me:

# redis-cli
> FLUSHDB
> FLUSHALL

Answered by question: How do I delete everything in Redis?

Community
  • 1
  • 1
Rjak
  • 2,097
  • 4
  • 19
  • 24