添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I just installed with pip but when I try to run it, I'm getting the strange error below. Any ideas what could be going on? Is it a bug?

$ sudo supervisorctl
error: <class 'socket.error'>, [Errno 97] Address family not supported by protocol: file: /usr/lib64/python2.6/socket.py line: 567

I get the exact same error on a freshly installed supervisor with the default configuration file as output by echo_supervisord_conf. I installed the configuration file locally, and am running it as a regular user and not root:

$ supervisorctl
error: <class 'socket.error'>, [Errno 97] Address family not supported by protocol: file: /usr/lib/python2.7/socket.py line: 571
supervisor>
miguelHx, vfxGer, jon-mcclung-sertainty, tresiab, luca-drf, namerspace, acidnag, Sturmtiger, tadrian88, swordfly, and LiorFradin reacted with thumbs up emoji Riotsmurf2 and skarkkai-p reacted with thumbs down emoji All reactions

Yup, that fixed it. I didn't realize I had to pass the configuration file to the supervisorctl call as well, but of course it make sense.. Sorry for the wrong alarm.

(Although a more descriptive error message instead of the failed socket connection would be more helpful. I don't even have a /etc/supervisor.conf file, so I would have imagined supervisorctl would have failed with a "Configuration file not found" error or something.)

A specific "not found" error should be emitted if supervisord can't find a config file. In later versions, there's also a different "not readable" error if supervisord finds one but can't read it. When -c is not used to specify an explicit path to a config file, supervisord will search for one .

supervisorctl will also search for a config file. Before Supervisor 3.0b2, a config file was always required and it would give an error as described above. In 3.0b2 and later, supervisorctl can be used without a config file. In that case, the connection info should be given in command line options. I think if it can't find a config file, and you don't give the connection options, it defaults to http://localhost:9001 with no auth. I'm not certain about that.

It sounds like supervisorctl is searching for and finding another config file on your system, but that file contains a line that causes the Address family not supported by protocol error. It could also be that supervisorctl is using its default but the default causes this error on your system. It would be helpful if we could get more info. The last time this was reported we didn't find out.

Edit: Clarified supervisorctl behavior.

Interesting. What was happening with me is that there was a supervisor.conf file in the current directory (the default one). When I run the command as supervisorctl I got the error, but when I switched to using supervisorctl -c supervisor.conf , I wouldn't get the error anymore. I should also note that this is from supervisor installed in a virtualenv.

From what I understand from your description, if a config file is found in the current directory, it should be used, and the behavior should be the same as running it explicitly with the -c switch. That's somehow not what happens on my end.

It appears that a commit in #95 introduced incorrect behavior (in particular, this commit: JensRantil@ 3385f17 ). It has been there since the end of 2011, and reverses the search order such that $CWD/etc/supervisord.conf will be found before $CWD/supervisord.conf .

I'll try to fix this in both the 3.1.X branch and master.

Not sure if there is a better issue to report this in, but seems related:

If I have a supervisord.conf in the current directory, but it has no supervisorctl section, then it's impossible to run supervisorctl with command line parameters:

$ supervisorctl -s "http://192.168.1.1:9001" -i
Error: .ini file does not include supervisorctl section
For help, use /usr/local/bin/supervisorctl -h

Running the same command in a different directory works fine.

I'd suggest either allowing explicit command line arguments to override the implicitly detected config file, or informing the user that they are ignored.

version 3.1.3

I've this same problem on centos, in my conf I've added a section [supervisord] in addition to my program conf.

$ easy_install supervisor
$ supervisord -v
3.2.1
$ supervisord -c /etc/supervisord.conf
$ supervisorctl restart program:secor -c /etc/supervisord.conf
Error: .ini file does not include supervisorctl section
For help, use /bin/supervisorctl -h

I fixed the issue by concatinating echo_supervisord_conf to my config file.

Hi, I used the supervisor on the Mac to write the configuration file to execute the command
supervisord - c/Users/wujunze/etc/supervisor. The conf
Then execute supervisorctl reported this error:

The supervisor > update
Error: < class 'socket. The error >, [61] Errno Connection refused: file: / System/Library/Frameworks/Python framework Versions / 2.7 / lib/python2.7 / socket. Py line: 575 ```
          

I also have the same problem

sudo supervisorctl -c /etc/supervisor/supervisord.conf
error: <class 'socket.error'>, [Errno 99] Cannot assign requested address: file: /usr/lib/python2.7/socket.py line: 575
supervisor>
  NaitikShah, xiaokli-in, sriramnambi, MythriNagaraju, yugaego, hiCabrera30, sahedbs23, lihliang, RSickenberg, NightOwlPrgmr, and prabba90rock reacted with thumbs up emoji
  jordanboston, kenugraha, rocramer, gitkv, and Zamiell reacted with thumbs down emoji
    All reactions
          

for me the solve was, the daemon was no running
sudo systemctl status supervisord
sudo systemctl enable supervisord
sudo systemctl start supervisord

ready
sudo supervisorctl reread
sudo supervisorctl start process:*

I came upon this issue with a similar error, when running in a Docker container:

# supervisorctl 
error: <class 'socket.error'>, [Errno 99] Cannot assign requested address: file: /usr/lib/python2.7/socket.py line: 575

The problem in my case was not a missing supervisord.conf in current directory, and -c supervisord.conf did not help. The problem was that the supervisord.conf in the current directory was just too thin, and was missing things that supervisorctl needs. Here's what I had to add:

[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
  m01, luisnabais, ahora-mismo, bodva, dawidgora-old-account, thinckx, christippett, wbednarczyk, GonzaloCenteno, ptrthomas, and 45 more reacted with thumbs up emoji
  caryxiao, akgitcom, lelinhtinh, and Rikj000 reacted with laugh emoji
  dawidgora-old-account, GonzaloCenteno, shinebayar-g, ptrthomas, mattbroekhuis, mlodic, andrejsstepanovs, AndrewFarley, dhuang919, SidneyNemzer, and 8 more reacted with hooray emoji
  ptrthomas, jose-magalhaes-deel, mattbroekhuis, AndrewFarley, dhuang919, SidneyNemzer, isudakoff, mhemrg, caryxiao, allxone, and 7 more reacted with heart emoji
  ziyadsfaxi reacted with rocket emoji
    All reactions
          

Docker:
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
The command '/bin/sh -c supervisorctl update' returned a non-zero code: 2

I have
I have encountered the same problem, but the usage scenario is that the virtual environment of anaconda, after the non-root user starts, the subsequent reload fails through the non-root user.

The error is as follows:
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/work/tool/anaconda3/envs/python27/lib/python2.7/socket.py line: 228

I came upon this issue with a similar error, when running in a Docker container:

# supervisorctl 
error: <class 'socket.error'>, [Errno 99] Cannot assign requested address: file: /usr/lib/python2.7/socket.py line: 575

The problem in my case was not a missing supervisord.conf in current directory, and -c supervisord.conf did not help. The problem was that the supervisord.conf in the current directory was just too thin, and was missing things that supervisorctl needs. Here's what I had to add:

[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

mark~

Facing the python file not found an error, code=exited, status=2 once I try with the official document but still same.
I have tried so many solutions for my laravel application.

But at last, I have tried with my solution.

Here is an example for the code :

[program:dev-worker]
process_name=%(program_name)s_%(process_num)02d
command=cd /var/www/html/example.com && php artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=ubuntu
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/html/example.com/storage/logs/laravel.log
stopwaitsecs=3600

Ref: https://laravel.com/docs/7.x/queues#supervisor-configuration

https://stackoverflow.com/questions/41286526/supervisor-no-such-file-socket-py/65791261#65791261

The suggestion from @javabrett unfortunately causes errors like the following to be logged at each startup:

CRIT Server 'unix_http_server' running without any HTTP authentication checking

As discussed in ticket #717, this can be avoided by securing the configuration. For example:

[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
username = dummy
password = impossibleToGuess
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
username = dummy
password = impossibleToGuess

I've tried the suggestions above, and I'm getting unix:///var/run/supervisor.sock no such file when configuring the supervisord.conf file as suggested. I'm inside a Docker container running Ubuntu 20.04

Same issue here. Did you manage to find a solution for it?