supervisor.sock: no such file
supervisorctl can’t reach supervisord: no such file and refused connection.

supervisorctl prints this when it can’t reach supervisord at all:
unix:///tmp/supervisor.sock no such fileThe address is the serverurl that supervisorctl read from its config, so yours may name another socket. no such file means there’s no socket at that path. Your programs may be fine; supervisorctl just can’t ask. There are three usual causes, in this order:
- supervisord isn’t running.
- supervisorctl reads a different config than supervisord, so it looks for the socket in the wrong place.
- Something deleted the socket while supervisord kept running.
Is supervisord running?
ps aux | grep '[s]upervisord'No output means it isn’t. Start it the way it was installed:
| Installed with | Command |
|---|---|
| Homebrew (macOS) | brew services start supervisor |
| Ubuntu or Debian package | sudo systemctl enable --now supervisor |
| Fedora package | sudo systemctl enable --now supervisord |
| Your own config | supervisord -c /path/to/supervisord.conf |
If it doesn’t stay up, run it in the foreground, where it prints why it stopped:
supervisord -n -c /path/to/supervisord.confFor a Linux service, systemctl status supervisor and journalctl -u supervisor show the same (supervisord on Fedora).
Do both read the same config?
If ps shows supervisord running, look at its command line. A -c in it names the config it was started with. supervisorctl, run without -c, takes the first config it finds in this order:
etc/supervisord.confandsupervisord.confbeside the folder supervisorctl is installed in, such as/opt/homebrew/etc/supervisord.conffor Homebrew;supervisord.confandetc/supervisord.confin the folder you run it from;/etc/supervisord.conf, then/etc/supervisor/supervisord.conf.
So a supervisord.conf in your project folder wins over the system one, and a supervisorctl installed with pip, in a virtualenv for example, can find a different file than the one supervisord uses. A /tmp/supervisor.sock in the message usually means it found a config made from supervisord’s sample file, which puts the socket in /tmp. Homebrew and the Linux packages don’t.
In the config supervisord uses, two lines must name the same socket:
[unix_http_server]
file=/opt/homebrew/var/run/supervisor.sock
[supervisorctl]
serverurl=unix:///opt/homebrew/var/run/supervisor.sockPoint supervisorctl at that config, or straight at the socket:
supervisorctl -c /opt/homebrew/etc/supervisord.conf status
supervisorctl -s unix:///opt/homebrew/var/run/supervisor.sock statusWhere the usual installs keep them:
| Installed with | Config | Socket |
|---|---|---|
| Homebrew (macOS) | $(brew --prefix)/etc/supervisord.conf | $(brew --prefix)/var/run/supervisor.sock |
| Ubuntu or Debian package | /etc/supervisor/supervisord.conf | /var/run/supervisor.sock |
| Fedora package | /etc/supervisord.conf | The file= line under [unix_http_server] |
brew --prefix is /opt/homebrew on Apple Silicon and /usr/local on Intel.
The socket was deleted
supervisord’s sample config warns that some systems delete older files in /tmp from time to time. If supervisord is running but its socket is gone, restart supervisord, and it makes a new one: brew services restart supervisor, or sudo systemctl restart supervisor. This restarts your programs too.
Then move the socket out of /tmp. Change file= under [unix_http_server] and serverurl= under [supervisorctl] together, to a folder nothing cleans, such as Homebrew’s var/run, and restart supervisord once more.
“refused connection” instead
unix:///tmp/supervisor.sock refused connectionThe socket file is there, but nothing answers on it. Usually supervisord crashed or was killed and left its old socket behind. Start supervisord again: it removes a stale socket by itself, and prints Unlinking stale socket with the path when it does.
With http://localhost:9001 refused connection, supervisorctl talks to supervisord over a port, set by [inet_http_server]. Check that the port= there matches the serverurl= under [supervisorctl].
Permission denied
If supervisorctl prints a Python error ending in Permission denied, supervisord is running and the socket exists, but your user can’t open it. Usually root started supervisord. See Permission denied on the socket.
With Visor
Visor finds the socket in supervisord’s config. When nothing answers there, the dashboard says Nothing answers at followed by the socket or address. In Doctor, Start supervisord starts it as you, never with sudo; for Homebrew’s config it runs brew services start supervisor. When supervisord fails to start, Doctor shows what it printed and the end of its log. If Visor finds no config in the usual places, Doctor asks Where is your config?. More in Troubleshooting.
The text is under CC BY 4.0: reuse it with credit to Touhidur Rahman and a link to this page. The code examples are free to copy.