Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supervisor socket error issue [closed]

Tags:

supervisord

$ supervisorctl reread
error: <class 'socket.error'>, [Errno 111] Connection refused: file: /usr/lib64/python2.6/socket.py line: 567

I'm trying to configure supervisor on my production system, but am hitting this error. The supervisor log file is empty.

When I just type supervisorctl, it complains:

http://localhost:9001 refused connection

Nothing is currently listening on port 9001, AFACT: lsof | grep TCP returns nothing.

like image 738
kelorek Avatar asked Sep 17 '13 20:09

kelorek


5 Answers

You have to start supervisord before you can use supervisorctl. In my case:

sudo supervisord -c /etc/supervisor/supervisord.conf
sudo supervisorctl -c /etc/supervisor/supervisord.conf
like image 122
kelorek Avatar answered Nov 04 '22 00:11

kelorek


If you started supervisord with a custom path, like this:

sudo supervisord -c /mypath/supervisord.conf

Then you should also start supervisorctl with the same parameter, like this:

sudo supervisorctl -c /mypath/supervisord.conf
like image 39
Jonathan Avatar answered Nov 04 '22 01:11

Jonathan


You can get this issue if you start supervisor with a relative url for -c and then try run supervisorctl from a different directory.

For example:

supervisord -c supervisord.conf
supervisorctl start someapp ## works 
cd somedirectory
supervisorctl restart someapp ## http://localhost:9001 refused connection

Solution would be to always use the absolute path. e.g.:

Good:

supervisord -c /etc/supervisor/supervisord.conf

Bad:

supervisord -c supervisord.conf
like image 13
toast38coza Avatar answered Nov 04 '22 00:11

toast38coza


This issue also occurs when an old vesion of supervisord.conf file is used. Newer version of supervisor uses different configuration file. The above solutions don't work. In this case you just have to regenerate the configuration file with

echo_supervisord_conf > /etc/supervisord.conf

Hope it helps someoone.

like image 5
Krishna Deepak Avatar answered Nov 04 '22 01:11

Krishna Deepak


please do the following :

sudo service supervisor start

post which everything is normal as b4 - there is a problem with 1b version

sudo supervisorctl reload

like image 4
VKB Avatar answered Nov 04 '22 01:11

VKB