Laraveldeep's avatar

Getting Python Socket Error When Starting Supervisor

Hi,

I am trying to setup the production version of my project in digital ocean droplet.

Currently trying to setup the Supervisor and following the documentation https://laravel.com/docs/5.3/queues#supervisor-configuration

I have tried these to start after I have configured my program, but I am getting following error:

sudo supervisorctl reread

error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
sudo supervisorctl update

error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228

What is this error mean? and how to look for to solve this?

0 likes
7 replies
moka's avatar

sudo service supervisord start && sudo supervisorctl reload

4 likes
Laraveldeep's avatar
Laraveldeep
OP
Best Answer
Level 7

Ok, found out that supervisord was not running. Manually running the program solved the problem.

1 like
prabhatraj_921's avatar

Hi am facing the same issue but am unable to resolve it by sudo service supervisord start && sudo supervisorctl reload

my supervisord is working

am getting error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib64/python2.7/socket.py line: 228

am using centOS

1 like
mandalatech's avatar

This is how I solved the issue. I hope this will help someone else in the future.

  1. Uninstall supervisor. sudo apt-get remove supervisor sudo apt-get purge supervisor

  2. Installed pip for python3. sudo apt update && sudo apt install python3-pip

  3. Install supervisor using pip. pip install supervisor

  4. Install supervisor again using apt-get. sudo apt-get install supervisor

cardei's avatar

In my case was because an error in horizon.conf in /etc/supervisor/conf.d in command=php /home/... the path was wrong

I solve it by putting the correct path and rebooting the server. (Ubuntu 22.04)

Please or to participate in this conversation.