Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection problems - Celery/Django

long night... can't get my second Celery/RabbitMQ setup run to work.

step 1

sudo rabbitmq-server

runs: ok!

step 2

python manage.py celeryd -l info

error: [2010-12-28 03:38:24,690: ERROR/MainProcess] CarrotListener: Connection Error: Socket closed. Trying again in 28 seconds...


I have definitely:

  • added rabbitmq user and vhost
  • updated the Django setings.py

Edit:

I think it might have to with installing from a .deb instead of apt-get.

After uninstalling the deb and installing the apt-get version I get this:

invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

My Solution:

apt-get --purge remove rabbitmq-server

apt-get install rabbitmq-server

...no comment...maybe need some sleep :)


Any ideas on how I could debug this? :|

like image 797
RadiantHex Avatar asked Oct 14 '22 19:10

RadiantHex


1 Answers

Check the different versions of RabbitMQ that you're using, newer versions have new features and may be incompatible with Celery. I've got the latest 2.3.1 version on my machine, installed from the RabbitMQ deb, this works OK unless you need to use SSL in which case you have to install a more recent version of Erlang/OTP, which is painful.

Also, it's probably better to use the init script to start the broker:

sudo /etc/init.d/rabbitmq-server start

If you start the broker from the init script you should be able to look at the broker error logs if the problem persists:

sudo tail -f /var/log/rabbit@<your-local-host>.log

HTH.

like image 153
Robin Avatar answered Oct 16 '22 07:10

Robin