Privacy Policy
Snippets index

  Supervisor: investigate startup errors

Use case: supervisor refuses to start:

$ supervisorctl status
unix:///var/run/supervisor.sock no such file

Log file doesn't help much:

$ tail -f /var/log/supervisor/supervisord.log
...
2018-05-21 08:23:48,043 CRIT Set uid to user 0
2018-05-21 08:23:48,043 WARN Included extra file "/etc/supervisor/conf.d/myproject.conf" during parsing
2018-05-21 08:24:38,374 CRIT Set uid to user 0
2018-05-21 08:24:38,374 WARN Included extra file "/etc/supervisor/conf.d/myproject.conf" during parsing

Retrieve more details about failing service:

$ service supervisor status
  supervisor.service - Supervisor process control system for UNIX
   Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2018-05-21 08:25:28 CEST; 31s ago
     Docs: http://supervisord.org
  Process: 14461 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
  Process: 14458 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2)
 Main PID: 14458 (code=exited, status=2)

May 21 08:25:28 www2 systemd[1]: supervisor.service: Unit entered failed state.
May 21 08:25:28 www2 systemd[1]: supervisor.service: Failed with result 'exit-code'.

We note from ExecStart that the process involved is run as /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

SOLUTION

Run process manually to display more detailed error messages:

$ /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
2018-05-21 08:26:26,622 CRIT Set uid to user 0
2018-05-21 08:26:26,622 WARN Included extra file "/etc/supervisor/conf.d/myproject.conf" during parsing
Error: Could not determine IP address for hostname www2, please try setting an explicit IP address in the "port" setting of your [inet_http_server] section.  For example, instead of "port = 9001", try "port = 127.0.0.1:9001."
For help, use /usr/bin/supervisord -h