Question

I am using Celery 2.6.0rc5, and getting the following error:

[2012-06-22 23:01:42,016: ERROR/MainProcess] Unrecoverable error: TypeError('handle_event() takes exactly 3 arguments (1 given)',)
Traceback (most recent call last):
  File "/home/bmh/celery/celery/worker/__init__.py", line 350, in start
    component.start()
  File "/home/bmh/celery/celery/worker/consumer.py", line 369, in start
    self.consume_messages()
  File "/home/bmh/celery/celery/worker/consumer.py", line 435, in consume_messages
    readers[fileno](fileno, event)
  File "/home/bmh/kombu/kombu/transport/redis.py", line 636, in handle_event
    self._callbacks[queue](message)
  File "/home/bmh/kombu/kombu/transport/virtual/__init__.py", line 461, in _callback
    return callback(message)
  File "/home/bmh/kombu/kombu/messaging.py", line 482, in _receive_callback
    self.receive(decoded, message)
  File "/home/bmh/kombu/kombu/messaging.py", line 454, in receive
    [callback(body, message) for callback in callbacks]
  File "/home/bmh/celery/celery/worker/consumer.py", line 397, in on_task_received
    [callback() for callback in on_task_callbacks]
TypeError: handle_event() takes exactly 3 arguments (1 given)

I pulled both kombu and celery from git just moments ago, and am trying this on Ubuntu 12.04 LTS with redis-server (2:2.2.12-1build1) installed as the broker.

My config (celeryconfig.py) is:

BROKER_URL = "redis://localhost:6379/0"
BACKEND_URL = BROKER_URL
CELERY_RESULT_BACKEND = "redis"
CELERY_REDIS_HOST = "localhost"
CELERY_REDIS_PORT = 6379
CELERY_REDIS_DB = 0

My worker (worker.py) is:

#!/usr/bin/python2.7
from celery import Celery

celery = Celery()

celery.config_from_object('celeryconfig')

@celery.task(ignore_result=True)
def atest(data):
    print "Got data: %s" % data

if __name__ == "__main__":
    celery.start()

When I run the worker with $ ./worker.py worker, and I call the worker as follows from a python shell:

import worker
worker.atest("abc")

The worker reports the above error, reports a longer error that ultimately ends with the worker quitting on the following:

[2012-06-22 23:01:43,025: WARNING/MainProcess] File "/home/bmh/kombu/kombu/utils/eventio.py", line 95, in unregister
[2012-06-22 23:01:43,025: WARNING/MainProcess] self._epoll.unregister(fd)
[2012-06-22 23:01:43,025: WARNING/MainProcess] ValueError
[2012-06-22 23:01:43,025: WARNING/MainProcess] :
[2012-06-22 23:01:43,026: WARNING/MainProcess] I/O operation on closed epoll fd

Incidentally, when I run $ ./worker.py shell and run "import kombu; kombu.version" it reports 2.2.2, which I understand to be the latest version. It may also be worth noting that someone else encountered this, but seemed to have solved it by updating kombu.

As this is really the simplest celery project I can imagine, I am completely new to celery, and this is a development version, I am a bit stumped on where to go from here and would be grateful for any assistance.

Thank you for reading.

Was it helpful?

Solution

I seem to have solved this by updating to the latest version of Billiard with:

$ git clone https://github.com/celery/billiard
$ cd billiard 
$ python setup.py develop
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top