unix:///var/run/supervisor.sock no such file #480

Closed
behnampmdg3 opened this Issue Aug 20, 2014 · 48 comments

Comments

@behnampmdg3

I don't seem to be able to get supervisor to run! Here are the details:

vagrant@homestead:/etc/supervisor$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
vagrant@homestead:/etc/su

vagrant@homestead:/etc/supervisor$ sudo apt-get install supervisor
Reading package lists... Done
Building dependency tree
Reading state information... Done
supervisor is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.

vagrant@homestead:/etc/supervisor$ sudo service supervisor restart
Restarting supervisor: supervisord.

vagrant@homestead:/etc/supervisor$ sudo supervisord
/usr/lib/python2.7/dist-packages/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching '

vagrant@homestead:/etc/supervisor$ sudo supervisorctl
unix:///var/run/supervisor.sock no such file
supervisor> help

default commands (type help ):

add clear fg open quit remove restart start stop update
avail exit maintail pid reload reread shutdown status tail version

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

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

Here are some more details:

vagrant@homestead:/etc/supervisor$ sudo apt-cache show supervisor
Package: supervisor
Priority: extra
Section: universe/admin
Installed-Size: 1485
Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
Original-Maintainer: Qijiang Fan fqj1994@gmail.com
Architecture: all
Version: 3.0b2-1
Depends: python, python-meld3, python-pkg-resources (>= 0.6c7)
Filename: pool/universe/s/supervisor/supervisor_3.0b2-1_all.deb
Size: 313972
MD5sum: 1e5ee03933451a0f4fc9ff391404f292
SHA1: d9dc47366e99e77b6577a9a82abd538c4982c58e
SHA256: f83f89a439cc8de5f2a545edbf20506695e4b477c579a5824c063fbaf94127c1
Description-en: A system for controlling process state
Supervisor is a system for controlling and maintaining process state,
similar to what init does, but not intended as an init replacement.
.
It will manage individual processes or groups of processes that
need to be started and stopped in order, and it is possible to
control individual process state via an rpc mechanism, thus allowing
ordinary users to restart processes.
Description-md5: b18ffbeaa3a697e8ccaee9cc104ec380
Homepage: http://supervisord.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Thanks

@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Aug 20, 2014

Contributor

You shouldn't have to do sudo supervisord. It should've already been started. I would try connecting after doing the restart.

Contributor

msabramo commented Aug 20, 2014

You shouldn't have to do sudo supervisord. It should've already been started. I would try connecting after doing the restart.

@behnampmdg3

This comment has been minimized.

Show comment
Hide comment
@behnampmdg3

behnampmdg3 Aug 20, 2014

Same thing:

vagrant@homestead:/etc/supervisor$ sudo service supervisor restart
Restarting supervisor: supervisord.
vagrant@homestead:/etc/supervisor$ sudo supervisorctl
unix:///var/run/supervisor.sock no such file
supervisor>

Same thing:

vagrant@homestead:/etc/supervisor$ sudo service supervisor restart
Restarting supervisor: supervisord.
vagrant@homestead:/etc/supervisor$ sudo supervisorctl
unix:///var/run/supervisor.sock no such file
supervisor>

@behnampmdg3

This comment has been minimized.

Show comment
Hide comment
@behnampmdg3

behnampmdg3 Aug 21, 2014

Anyone knows about this?

Anyone knows about this?

@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Aug 21, 2014

Contributor

Is supervisord running?

pgrep -fl supervisor

If it's not, you need to figure out why; maybe look at tail -f /var/log/supervisor/supervisord.log

If it is running, then probably the config is not as expected. I would try using lsof:

vagrant@vagrant-ubuntu-trusty-64:~$ sudo lsof -c supervisord | egrep 'COMMAND|sock'
COMMAND    PID USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
superviso 2240 root    5u  unix 0xffff8800374fa300      0t0 171865 /var/run/supervisor.sock.2233

Make sure that supervisord and supervisorctl are both using the same config file. They both support a -c option to explicitly specify the config file; this may come in handy.

Contributor

msabramo commented Aug 21, 2014

Is supervisord running?

pgrep -fl supervisor

If it's not, you need to figure out why; maybe look at tail -f /var/log/supervisor/supervisord.log

If it is running, then probably the config is not as expected. I would try using lsof:

vagrant@vagrant-ubuntu-trusty-64:~$ sudo lsof -c supervisord | egrep 'COMMAND|sock'
COMMAND    PID USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
superviso 2240 root    5u  unix 0xffff8800374fa300      0t0 171865 /var/run/supervisor.sock.2233

Make sure that supervisord and supervisorctl are both using the same config file. They both support a -c option to explicitly specify the config file; this may come in handy.

@behnampmdg3

This comment has been minimized.

Show comment
Hide comment
@behnampmdg3

behnampmdg3 Aug 21, 2014

Hey

This file does not exist on my computer: /var/run/supervisor.sock

Here is the code you sent:

vagrant@homestead:/etc/supervisor$ pgrep -fl supervisor
vagrant@homestead:/etc/supervisor$ tail -f /var/log/supervisor/supervisord.log
2014-08-21 06:42:44,699 INFO RPC interface 'supervisor' initialized
2014-08-21 06:42:44,699 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-21 06:42:44,709 INFO daemonizing the supervisord process
2014-08-21 06:42:44,721 INFO supervisord started with pid 32042
2014-08-21 06:46:24,288 CRIT Supervisor running as root (no user in config file)
2014-08-21 06:46:24,288 WARN Included extra file "/etc/supervisor/conf.d/queue.conf" during parsing
2014-08-21 06:46:24,353 INFO RPC interface 'supervisor' initialized
2014-08-21 06:46:24,353 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-21 06:46:24,364 INFO daemonizing the supervisord process
2014-08-21 06:46:24,372 INFO supervisord started with pid 32081

vagrant@homestead:/etc/supervisor$ sudo lsof -c supervisord | egrep 'COMMAND|sock'
vagrant@homestead:/etc/supervisor$

This is /etc/supervisor/supervisord.conf

vagrant@homestead:/etc/supervisor$ cat supervisord.conf
; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket

; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files cannot
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf
vagrant@homestead:/etc/supervisor$

Hey

This file does not exist on my computer: /var/run/supervisor.sock

Here is the code you sent:

vagrant@homestead:/etc/supervisor$ pgrep -fl supervisor
vagrant@homestead:/etc/supervisor$ tail -f /var/log/supervisor/supervisord.log
2014-08-21 06:42:44,699 INFO RPC interface 'supervisor' initialized
2014-08-21 06:42:44,699 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-21 06:42:44,709 INFO daemonizing the supervisord process
2014-08-21 06:42:44,721 INFO supervisord started with pid 32042
2014-08-21 06:46:24,288 CRIT Supervisor running as root (no user in config file)
2014-08-21 06:46:24,288 WARN Included extra file "/etc/supervisor/conf.d/queue.conf" during parsing
2014-08-21 06:46:24,353 INFO RPC interface 'supervisor' initialized
2014-08-21 06:46:24,353 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-21 06:46:24,364 INFO daemonizing the supervisord process
2014-08-21 06:46:24,372 INFO supervisord started with pid 32081

vagrant@homestead:/etc/supervisor$ sudo lsof -c supervisord | egrep 'COMMAND|sock'
vagrant@homestead:/etc/supervisor$

This is /etc/supervisor/supervisord.conf

vagrant@homestead:/etc/supervisor$ cat supervisord.conf
; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket

; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files cannot
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf
vagrant@homestead:/etc/supervisor$

@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Aug 22, 2014

Member

Please ask questions about installing or using Supervisor on the mailing list.

Member

mnaberez commented Aug 22, 2014

Please ask questions about installing or using Supervisor on the mailing list.

@mnaberez mnaberez closed this Aug 22, 2014

@kovacshuni

This comment has been minimized.

Show comment
Hide comment
@kovacshuni

kovacshuni Apr 29, 2015

Same problem here, don't know how to solve it yet. :(

Same problem here, don't know how to solve it yet. :(

@ethought

This comment has been minimized.

Show comment
Hide comment
@ethought

ethought May 5, 2015

Same problem here

ethought commented May 5, 2015

Same problem here

@rodrigobendia

This comment has been minimized.

Show comment
Hide comment
@rodrigobendia

rodrigobendia Jun 9, 2015

This should solve this problem:

sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart

This should solve this problem:

sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart
@srikiraju

This comment has been minimized.

Show comment
Hide comment
@srikiraju

srikiraju Jun 12, 2015

Make sure you have a [unix_http_server] and [rpcinterface:supervisor] section in your conf file

Make sure you have a [unix_http_server] and [rpcinterface:supervisor] section in your conf file

@xzyaoi

This comment has been minimized.

Show comment
Hide comment
@xzyaoi

xzyaoi Aug 1, 2015

@rodrigobendia it doesn't work.

xzyaoi commented Aug 1, 2015

@rodrigobendia it doesn't work.

@rex

This comment has been minimized.

Show comment
Hide comment
@rex

rex Aug 25, 2015

@rodrigobendia I'm having mixed results with those commands as well. As far as I can see, they work. I'm just working inside a Docker container and something keeps killing the /var/run/supervisor.sock file :) I'll try and remember to update here if/when I figure it out.

rex commented Aug 25, 2015

@rodrigobendia I'm having mixed results with those commands as well. As far as I can see, they work. I'm just working inside a Docker container and something keeps killing the /var/run/supervisor.sock file :) I'll try and remember to update here if/when I figure it out.

@jartaud

This comment has been minimized.

Show comment
Hide comment
@jartaud

jartaud Sep 3, 2015

@rodrigobendia works for me. Thanks!

jartaud commented Sep 3, 2015

@rodrigobendia works for me. Thanks!

@vikas-sharma1

This comment has been minimized.

Show comment
Hide comment
@vikas-sharma1

vikas-sharma1 Oct 3, 2015

I found the fix. Please try.

please add below 2 section to your supervisord.conf -

[unix_http_server]
file = /var/tmp/supervisor.sock ;

[rpcinterface:supervisor]
supervisor.rpcinterface_factory =
supervisor.rpcinterface:make_main_rpcinterface

Thanks
Vikas

I found the fix. Please try.

please add below 2 section to your supervisord.conf -

[unix_http_server]
file = /var/tmp/supervisor.sock ;

[rpcinterface:supervisor]
supervisor.rpcinterface_factory =
supervisor.rpcinterface:make_main_rpcinterface

Thanks
Vikas

@codingwithoutcomments

This comment has been minimized.

Show comment
Hide comment
@codingwithoutcomments

codingwithoutcomments Nov 4, 2015

@rex did you figure out why the the sock file was being killed inside the docker container?

@rex did you figure out why the the sock file was being killed inside the docker container?

@rex

This comment has been minimized.

Show comment
Hide comment
@rex

rex Nov 13, 2015

@codingwithoutcomments I didn't, unfortunately. I was working on it for a contract gig at the time that has since ended and I no longer have access to the machine in question. :-/

rex commented Nov 13, 2015

@codingwithoutcomments I didn't, unfortunately. I was working on it for a contract gig at the time that has since ended and I no longer have access to the machine in question. :-/

@liutxer

This comment has been minimized.

Show comment
Hide comment
@liutxer

liutxer Dec 17, 2015

may be you conf file raise this error. you should check you conf

liutxer commented Dec 17, 2015

may be you conf file raise this error. you should check you conf

@raphaelsoul

This comment has been minimized.

Show comment
Hide comment
@raphaelsoul

raphaelsoul Mar 22, 2016

I have had the same problem both on my Ubuntu 14.04 Lts and CentOS 7.0.1 server. It runs well untill last week.

After viewing the issues and checking the command outputting on my server. It should be caused by the permissions of directory.

The configure I used before the outputting of command echo_supervisord_conf,which indicate the file in [unix_http_server] and serverurl in [supervisorctl] section to /tmp/supervisor.sock. permission is 0770.

And I got

unix:///tmp/supervisor.sock no such file

Now I configure it to /var/run/supervisor.sock. And it works now again.

Hope this will be helpful

I have had the same problem both on my Ubuntu 14.04 Lts and CentOS 7.0.1 server. It runs well untill last week.

After viewing the issues and checking the command outputting on my server. It should be caused by the permissions of directory.

The configure I used before the outputting of command echo_supervisord_conf,which indicate the file in [unix_http_server] and serverurl in [supervisorctl] section to /tmp/supervisor.sock. permission is 0770.

And I got

unix:///tmp/supervisor.sock no such file

Now I configure it to /var/run/supervisor.sock. And it works now again.

Hope this will be helpful

@lucian303

This comment has been minimized.

Show comment
Hide comment
@lucian303

lucian303 Mar 30, 2016

Still getting this problem in docker with Ubuntu 14.04 and supervisord 3.0b2

This issue also seems to be a duplicate of:
#121

I'm going to open a new issue since both are closed.

Still getting this problem in docker with Ubuntu 14.04 and supervisord 3.0b2

This issue also seems to be a duplicate of:
#121

I'm going to open a new issue since both are closed.

@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Mar 30, 2016

Member

I'm going to open a new issue since both are closed.

Please do not open duplicate issues.

Member

mnaberez commented Mar 30, 2016

I'm going to open a new issue since both are closed.

Please do not open duplicate issues.

@lucian303

This comment has been minimized.

Show comment
Hide comment
@lucian303

lucian303 Mar 30, 2016

@mnaberez I'll just post this here then:

Test system: Clean Ubuntu 14.04 install with supervisord 3.0b2 inside a docker container.

To save time:

  • It's not a config file issue. The config file exists and is being read (tried implicitly and explicitly).
  • The socket file does not exist when I inspect the system
  • Supervisor starts up correctly (see logs below)
  • Supervisor runs with default config.
  • Supervisor is running. Controlling it is not possible.
  • Changing sock file permissions to 770 does nothing.
  • /run (or /var/run) has the correct permissions and supervisord is started by root
  • This is reproducible in multiple images

Previous issues:
#480
#121

supervisor.log:

2016-03-30 00:55:52,592 CRIT Supervisor running as root (no user in config file)
2016-03-30 00:55:52,603 INFO supervisord started with pid 6
2016-03-30 00:55:53,605 INFO spawned: 'nginx' with pid 9
2016-03-30 00:55:53,606 INFO spawned: 'php-fpm' with pid 10
2016-03-30 00:55:53,609 INFO spawned: 'newrelic-sysmond' with pid 11
2016-03-30 00:55:53,701 INFO success: newrelic-sysmond entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-03-30 00:55:54,919 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-03-30 00:55:54,919 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-03-30 00:55:54,919 INFO exited: newrelic-sysmond (exit status 0; expected)

conf.d/supervisord.conf:

[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
user = root
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true

[program:php-fpm]
command=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
user = root
autostart = true
autorestart = true

[program:newrelic-sysmond]
command=service newrelic-sysmond start
user = root
autostart = true
startsecs=0

@mnaberez I'll just post this here then:

Test system: Clean Ubuntu 14.04 install with supervisord 3.0b2 inside a docker container.

To save time:

  • It's not a config file issue. The config file exists and is being read (tried implicitly and explicitly).
  • The socket file does not exist when I inspect the system
  • Supervisor starts up correctly (see logs below)
  • Supervisor runs with default config.
  • Supervisor is running. Controlling it is not possible.
  • Changing sock file permissions to 770 does nothing.
  • /run (or /var/run) has the correct permissions and supervisord is started by root
  • This is reproducible in multiple images

Previous issues:
#480
#121

supervisor.log:

2016-03-30 00:55:52,592 CRIT Supervisor running as root (no user in config file)
2016-03-30 00:55:52,603 INFO supervisord started with pid 6
2016-03-30 00:55:53,605 INFO spawned: 'nginx' with pid 9
2016-03-30 00:55:53,606 INFO spawned: 'php-fpm' with pid 10
2016-03-30 00:55:53,609 INFO spawned: 'newrelic-sysmond' with pid 11
2016-03-30 00:55:53,701 INFO success: newrelic-sysmond entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-03-30 00:55:54,919 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-03-30 00:55:54,919 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-03-30 00:55:54,919 INFO exited: newrelic-sysmond (exit status 0; expected)

conf.d/supervisord.conf:

[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
user = root
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true

[program:php-fpm]
command=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
user = root
autostart = true
autorestart = true

[program:newrelic-sysmond]
command=service newrelic-sysmond start
user = root
autostart = true
startsecs=0
@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Mar 30, 2016

Member

The configuration file above is missing a [unix_http_server] section, a [supervisorctl] section, and an [rpcinterface:supervisor] section. supervisord is not creating a socket file because it has not been configured to do so in the configuration file. See the configuration guide and the output of echo_supervisord_conf for examples of these sections.

Member

mnaberez commented Mar 30, 2016

The configuration file above is missing a [unix_http_server] section, a [supervisorctl] section, and an [rpcinterface:supervisor] section. supervisord is not creating a socket file because it has not been configured to do so in the configuration file. See the configuration guide and the output of echo_supervisord_conf for examples of these sections.

@lucian303

This comment has been minimized.

Show comment
Hide comment
@lucian303

lucian303 Mar 30, 2016

@mnaberez Sorry I wasn't clearer. The supervisord config file at /etc/supervisor/supervisord.conf is the default one. That's just the one in conf.d (it has the same name cause that's the only way I could get supervisor to see it).

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

@mnaberez Sorry I wasn't clearer. The supervisord config file at /etc/supervisor/supervisord.conf is the default one. That's just the one in conf.d (it has the same name cause that's the only way I could get supervisor to see it).

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf
@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Mar 30, 2016

Member

If this configuration was being used, your log file should contain these lines:

INFO RPC interface 'supervisor' initialized
CRIT Server 'unix_http_server' running without any HTTP authentication checking

The first line is logged when [rpcinterface:supervisor] is read. The second line is logged when a [unix_http_server] section is specified without a username/password.

Since these lines are absent from your log, it does appear that supervisord hasn't been configured correctly. I would check the configuration again, e.g. perhaps supervisord is not using the configuration file(s) you think it is.

Member

mnaberez commented Mar 30, 2016

If this configuration was being used, your log file should contain these lines:

INFO RPC interface 'supervisor' initialized
CRIT Server 'unix_http_server' running without any HTTP authentication checking

The first line is logged when [rpcinterface:supervisor] is read. The second line is logged when a [unix_http_server] section is specified without a username/password.

Since these lines are absent from your log, it does appear that supervisord hasn't been configured correctly. I would check the configuration again, e.g. perhaps supervisord is not using the configuration file(s) you think it is.

@lucian303

This comment has been minimized.

Show comment
Hide comment
@lucian303

lucian303 Mar 30, 2016

@mnaberez You're right. That was the problem. I had accidentally explicitly specified the config file as the one in conf.d, which apparently leads to the above also. facepalm Thanks so much for your help!

@mnaberez You're right. That was the problem. I had accidentally explicitly specified the config file as the one in conf.d, which apparently leads to the above also. facepalm Thanks so much for your help!

@Longbingfeihua

This comment has been minimized.

Show comment
Hide comment

yes itis!

@timothy12387

This comment has been minimized.

Show comment
Hide comment
@timothy12387

timothy12387 Apr 19, 2016

@rodrigobendia it works for me.. thanks

@rodrigobendia it works for me.. thanks

@lifeofguenter

This comment has been minimized.

Show comment
Hide comment
@lifeofguenter

lifeofguenter Jul 22, 2016

Why is this being closed with work arounds but no real fix? Does not work here as well (Debian 8).

Why is this being closed with work arounds but no real fix? Does not work here as well (Debian 8).

@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Jul 22, 2016

Member

Why is this being closed with work arounds but no real fix?

There's no single fix because there are many reasons why the file might not be found, and we can't control most of them: supervisord might not be running and thus didn't create it, supervisord might be running but the file may have been deleted by something else, there may be a misconfiguration, or it may even be a problem in distribution packaging. We've troubleshot this problem on the mailing list and several issues, but in all the cases I'm aware of, it ended up being one of those issues. We certainly try to fix bugs we are aware of, but at this time we don't know a bug related to this that we can fix.

Member

mnaberez commented Jul 22, 2016

Why is this being closed with work arounds but no real fix?

There's no single fix because there are many reasons why the file might not be found, and we can't control most of them: supervisord might not be running and thus didn't create it, supervisord might be running but the file may have been deleted by something else, there may be a misconfiguration, or it may even be a problem in distribution packaging. We've troubleshot this problem on the mailing list and several issues, but in all the cases I'm aware of, it ended up being one of those issues. We certainly try to fix bugs we are aware of, but at this time we don't know a bug related to this that we can fix.

@bbayles

This comment has been minimized.

Show comment
Hide comment
@bbayles

bbayles Jul 22, 2016

For what it's worth, multiple people in this thread have mentioned having problems when running in Docker containers.

Do see this issue in the Docker tracker. There is a problem with Unix sockets inside Docker. I ran into the problem myself some time ago and had to switch to a TCP socket.

bbayles commented Jul 22, 2016

For what it's worth, multiple people in this thread have mentioned having problems when running in Docker containers.

Do see this issue in the Docker tracker. There is a problem with Unix sockets inside Docker. I ran into the problem myself some time ago and had to switch to a TCP socket.

@lifeofguenter

This comment has been minimized.

Show comment
Hide comment
@lifeofguenter

lifeofguenter Jul 23, 2016

@mnaberez, suggestion: would it then not be possible to introduce some kind of config-check or similar to make sure that the environment and configuration would allow supervisord to run properly? And in doubt would barf something into the logs?

I have been using supervisor successfully on rhel - so if it works, it works pretty well, but if it doesn't, then it gets a real pita to debug.

Most prolly supervisord will be deprecated very soon in favour of systemd which features basically everything (and more) and just works. So not sure how much has to be still invested into supervisord.

@mnaberez, suggestion: would it then not be possible to introduce some kind of config-check or similar to make sure that the environment and configuration would allow supervisord to run properly? And in doubt would barf something into the logs?

I have been using supervisor successfully on rhel - so if it works, it works pretty well, but if it doesn't, then it gets a real pita to debug.

Most prolly supervisord will be deprecated very soon in favour of systemd which features basically everything (and more) and just works. So not sure how much has to be still invested into supervisord.

@mnaberez

This comment has been minimized.

Show comment
Hide comment
@mnaberez

mnaberez Jul 23, 2016

Member

would it then not be possible to introduce some kind of config-check or similar to make sure that the environment and configuration would allow supervisord to run properly? And in doubt would barf something into the logs?

I think it already does what we know how to do, but maybe we can add a "Troubleshooting" section to the documentation.

Member

mnaberez commented Jul 23, 2016

would it then not be possible to introduce some kind of config-check or similar to make sure that the environment and configuration would allow supervisord to run properly? And in doubt would barf something into the logs?

I think it already does what we know how to do, but maybe we can add a "Troubleshooting" section to the documentation.

@codepushr

This comment has been minimized.

Show comment
Hide comment
@codepushr

codepushr Aug 23, 2016

I have the weird behaviour that under Ubuntu 16.04 the permissons (0700) for /var/run/supervisor.sock are always being reset after reboot which leads to the error in the issue's title. I always have to manually assign mod 0700 after reboot so supervisor can work properly again. Any clues?

I have the weird behaviour that under Ubuntu 16.04 the permissons (0700) for /var/run/supervisor.sock are always being reset after reboot which leads to the error in the issue's title. I always have to manually assign mod 0700 after reboot so supervisor can work properly again. Any clues?

@raagin

This comment has been minimized.

Show comment
Hide comment
@raagin

raagin Sep 1, 2016

sudo systemctl enable supervisor
sudo systemctl start supervisor

I found solution here

raagin commented Sep 1, 2016

sudo systemctl enable supervisor
sudo systemctl start supervisor

I found solution here

@StalkAlex

This comment has been minimized.

Show comment
Hide comment
@StalkAlex

StalkAlex Sep 9, 2016

Had the same error. Run just supervisord in console and it showed that I simply forgot to create log file for my command, after creating it problem has gone.

Had the same error. Run just supervisord in console and it showed that I simply forgot to create log file for my command, after creating it problem has gone.

@nodermann

This comment has been minimized.

Show comment
Hide comment
@nodermann

nodermann Sep 19, 2016

sudo service supervisor start

sudo service supervisor start

clebio added a commit to clebio/django-docker that referenced this issue Sep 25, 2016

@clebio clebio referenced this issue in morninj/django-docker Sep 25, 2016

Merged

Fix for overlay filesystem issue in docker, on Mac OSX #21

@dariogomez

This comment has been minimized.

Show comment
Hide comment
@dariogomez

dariogomez Nov 25, 2016

thanks @rodrigobendia! It's works for me

thanks @rodrigobendia! It's works for me

@dkavraal

This comment has been minimized.

Show comment
Hide comment
@dkavraal

dkavraal Mar 23, 2017

I believe there are differences between distributor packages and pip package. The error yields of that. (first installing with yum/apt then pip upgrade or vice versa)

dkavraal commented Mar 23, 2017

I believe there are differences between distributor packages and pip package. The error yields of that. (first installing with yum/apt then pip upgrade or vice versa)

@aldee07

This comment has been minimized.

Show comment
Hide comment
@aldee07

aldee07 Jun 25, 2017

I know this question is kinda old but for the sake of others who happen to land to this problem, starting the supervisor daemon works for me.

sudo service supervisor start

A more detailed explanation is that in general, when you encounter a "unix:///var/run/blabla.sock no such file" error, most likely the issue is that the daemon of the program in subject (supervisord in this case) wasn't started and thus wasn't able to generate the expected unix socket supervisor.sock file. This file is the communication endpoint for the supervisor foreground commands (such as supervisorctl) that acts as a tunnel/middleman responsible for relaying user-issued commands (ex. supervisorctl reread) to the supervisor service running in background.

You can refer to Unix Domain Socket and to this stackoverflow answer.

aldee07 commented Jun 25, 2017

I know this question is kinda old but for the sake of others who happen to land to this problem, starting the supervisor daemon works for me.

sudo service supervisor start

A more detailed explanation is that in general, when you encounter a "unix:///var/run/blabla.sock no such file" error, most likely the issue is that the daemon of the program in subject (supervisord in this case) wasn't started and thus wasn't able to generate the expected unix socket supervisor.sock file. This file is the communication endpoint for the supervisor foreground commands (such as supervisorctl) that acts as a tunnel/middleman responsible for relaying user-issued commands (ex. supervisorctl reread) to the supervisor service running in background.

You can refer to Unix Domain Socket and to this stackoverflow answer.

@fusion2222

This comment has been minimized.

Show comment
Hide comment
@fusion2222

fusion2222 Jul 1, 2017

In my case, this error was caused by missing log files. Check it if path with log files really exist. If not, create it.

In my case, this error was caused by missing log files. Check it if path with log files really exist. If not, create it.

@chuanjin

This comment has been minimized.

Show comment
Hide comment
@chuanjin

chuanjin Jul 5, 2017

I am using Ubuntu 16.04
For me, the issue is that if I use pip to install the latest version (3.3.2), I alway get this "No such file" issue, and I have basically tried all the solutions above but without any luck. However when I remove the latest version and install via apt, and I end up with version 3.2.0, and everything works fine now.

chuanjin commented Jul 5, 2017

I am using Ubuntu 16.04
For me, the issue is that if I use pip to install the latest version (3.3.2), I alway get this "No such file" issue, and I have basically tried all the solutions above but without any luck. However when I remove the latest version and install via apt, and I end up with version 3.2.0, and everything works fine now.

@frutality

This comment has been minimized.

Show comment
Hide comment
@frutality

frutality Oct 10, 2017

For me it was just sudo systemctl start supervisor command, but for some reason I had to type it twice. First time I type it nothing happens - workers don't start and I can't start them manually. But second time I type it, workers start fine.

I installed supervisor with pip on Ubuntu 16.04. Same behaviour at vagrant machine and Digital Ocean droplet.

For me it was just sudo systemctl start supervisor command, but for some reason I had to type it twice. First time I type it nothing happens - workers don't start and I can't start them manually. But second time I type it, workers start fine.

I installed supervisor with pip on Ubuntu 16.04. Same behaviour at vagrant machine and Digital Ocean droplet.

@farialima

This comment has been minimized.

Show comment
Hide comment
@farialima

farialima Oct 21, 2017

To summarize: this problem occurs mainly in two cases:

  • either the supervisord daemon didn't start correctly. In which case rerunning/restarting (e.g. sudo systemctl start supervisor on a recent ubuntu) may fix it. Or trying to start from the command line and see if an error appears (e.g. sudo supervisord -c /etc/supervisor/supervisord.conf on ubuntu if you installed using apt)
  • or, the command-line supervisorctl can't find a way to connect to the server. This can occur on Ubuntu when you have customized the socket that the server uses, in particular if you have done it in a custom configuration file (under /etc/supervisor/conf.d/* on ubuntu if you installed using apt) because custom configuration files are not used by supervisorctl. This is at least poorly documented; I've entered it as #1007.

In the second case, the issue can be complex to understand, because when no configuration is provided for supervisorctl to connect to the server, it will try to connect on http://localhost:9001, which will work if inet_http_server is configured on the server. So, adding a configuration setting for supervisorctl (e.g. connecting as socket in a [supervisorctl] section of your config file) may make it fail even though it worked before.

farialima commented Oct 21, 2017

To summarize: this problem occurs mainly in two cases:

  • either the supervisord daemon didn't start correctly. In which case rerunning/restarting (e.g. sudo systemctl start supervisor on a recent ubuntu) may fix it. Or trying to start from the command line and see if an error appears (e.g. sudo supervisord -c /etc/supervisor/supervisord.conf on ubuntu if you installed using apt)
  • or, the command-line supervisorctl can't find a way to connect to the server. This can occur on Ubuntu when you have customized the socket that the server uses, in particular if you have done it in a custom configuration file (under /etc/supervisor/conf.d/* on ubuntu if you installed using apt) because custom configuration files are not used by supervisorctl. This is at least poorly documented; I've entered it as #1007.

In the second case, the issue can be complex to understand, because when no configuration is provided for supervisorctl to connect to the server, it will try to connect on http://localhost:9001, which will work if inet_http_server is configured on the server. So, adding a configuration setting for supervisorctl (e.g. connecting as socket in a [supervisorctl] section of your config file) may make it fail even though it worked before.

@KeithTt

This comment has been minimized.

Show comment
Hide comment
@KeithTt

KeithTt Feb 13, 2018

meet this problem...

I was trying alpine OS, in my case, error output this:

# supervisord
/usr/lib/python2.7/site-packages/supervisor/options.py:298: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
Error: /var/log/supervisor is not an existing directory

Then I create this dir /var/log/supervisor and restart supervisord, it works...

KeithTt commented Feb 13, 2018

meet this problem...

I was trying alpine OS, in my case, error output this:

# supervisord
/usr/lib/python2.7/site-packages/supervisor/options.py:298: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
Error: /var/log/supervisor is not an existing directory

Then I create this dir /var/log/supervisor and restart supervisord, it works...

@sigurdurb

This comment has been minimized.

Show comment
Hide comment
@sigurdurb

sigurdurb Feb 15, 2018

Fixed it by seeing that there still were some processes running
check netstat -lp
Thats why it was refusing the socket connection for me.
So killing those proccesses and
Then supervisorctl reload worked.

Edit: Now I think the problem was environment variables, so I set NODE_PATH like this environment=NODE_PATH=%(ENV_NODE_PATH)s
while I had already done export NODE_PATH=/usr/lib/node_modules and doing env displayed it.
but only the "%(ENV_NODE_PATH)s" part specifically did not work, it always crashed. Removing that and just hardcoding the variable worked however. sudo systemctl start supervisor was also helpful.

sigurdurb commented Feb 15, 2018

Fixed it by seeing that there still were some processes running
check netstat -lp
Thats why it was refusing the socket connection for me.
So killing those proccesses and
Then supervisorctl reload worked.

Edit: Now I think the problem was environment variables, so I set NODE_PATH like this environment=NODE_PATH=%(ENV_NODE_PATH)s
while I had already done export NODE_PATH=/usr/lib/node_modules and doing env displayed it.
but only the "%(ENV_NODE_PATH)s" part specifically did not work, it always crashed. Removing that and just hardcoding the variable worked however. sudo systemctl start supervisor was also helpful.

@homeworkprod

This comment has been minimized.

Show comment
Hide comment
@homeworkprod

homeworkprod Mar 30, 2018

Ran into "unix:///var/run/supervisor.sock no such file" as well, on Debian Stretch.

In my case that symptom was caused by program configuration files (/etc/supervisor/conf.d/*.conf) copied from another server that included user directives without the specified user names actually existing on the system in question.

I discovered the helpful error message in the output of systemd's # journalctl -xn, but not in supervisor's own logfile (/var/log/supervisor/supervisor.log in my case).

So now I can use supervisorctl without the error message (see first paragraph) appearing, and it seems to work.
And that without setting username and password anywhere and/or switching from unix_http_server to inet_http_server (like I did on the other server for whatever reason years ago).

homeworkprod commented Mar 30, 2018

Ran into "unix:///var/run/supervisor.sock no such file" as well, on Debian Stretch.

In my case that symptom was caused by program configuration files (/etc/supervisor/conf.d/*.conf) copied from another server that included user directives without the specified user names actually existing on the system in question.

I discovered the helpful error message in the output of systemd's # journalctl -xn, but not in supervisor's own logfile (/var/log/supervisor/supervisor.log in my case).

So now I can use supervisorctl without the error message (see first paragraph) appearing, and it seems to work.
And that without setting username and password anywhere and/or switching from unix_http_server to inet_http_server (like I did on the other server for whatever reason years ago).

@najashark najashark referenced this issue in cuckoosandbox/cuckoo Apr 10, 2018

Open

Cuckoo distributed not working #1820

@avinashkuv

This comment has been minimized.

Show comment
Hide comment
@avinashkuv

avinashkuv May 21, 2018

Replace this
[unix_http_server]
file=/var/run/supervisor.sock

with

[unix_http_server]
file=/tmp/supervisor.sock

then restart the supervisor it will work. it throws an error because the user doesn't have permission create sock file

Replace this
[unix_http_server]
file=/var/run/supervisor.sock

with

[unix_http_server]
file=/tmp/supervisor.sock

then restart the supervisor it will work. it throws an error because the user doesn't have permission create sock file

@ercancavusoglu

This comment has been minimized.

Show comment
Hide comment
@ercancavusoglu

ercancavusoglu Jun 19, 2018

touch /var/run/supervisor.sock
sudo supervisord -c /etc/supervisor/supervisord.conf
and after ,
supervisorctl restart all

touch /var/run/supervisor.sock
sudo supervisord -c /etc/supervisor/supervisord.conf
and after ,
supervisorctl restart all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment