tunaktunak tunaktunak - 10 months ago 130
Python Question

Python Celery socket.error: [Errno 61] Connection refused

I am using Celery 3.0 and have the configuration file like below.


BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

CELERY_IMPORTS = ("tasks", )


import celery

def function(x,y):
return x + y

and function.py

from tasks import function

print function.delay(4,4).get()

I run the application with following command

celeryd --loglevel=INFO --config=celeryconfig

Everything is working great till now. I have redis and celery running and getting answers.

But when I run the function command from another file called parallelizer,

I get the socket error,

socket.error: [Errno 61] Connection refused

My file is like below,

from examples.dummy.tasks import function
print function.delay(4,4).get()

Any ideas ?

Answer Source

Problem was,

I was running celeryconfig.py under from a different path than my parallelizer.

When I carried the celeryconfig.py to same path with paralellizer it fixed the issue.