The nginx+supervisord configuration section in deployment doc is incorrect. We tried to replicate steps mentioned in the nginx+supervisord configuration section but failed
We expected the steps to be replicated and executed smoothly.
We hit the roadblock when we tried to install and use supervisord.
As per Supervisord link provided in the nginx+supervisord configuration section, we tried to install supervisord via pip3,
pip3 install supervisor
But got below error:
Supervisor requires Python 2.4 or later but does not work on any version of Python 3. You are using version 3.5.2 (default, Nov 17 2016, 17:05:23)
Upon further investigation, we found the same warning mentioned in Supervisord doc:
Supervisor is known to work with Python 2.4 or later but will not work under any version of Python 3.
Also, Supervisord Github repo doc mentions that,
Supervisor does not work on Python 3. This is the master branch, which has work-in-progress support for Python 3. Supervisor is very likely to crash, cause subprocesses to hang, or otherwise behave unexpectedly when run on Python 3. See issues running Supervisor on Python 3. It may also have regressions on Python 2 as a result of attempts to add Python 3 support. Help from developers with Python 3 porting experience is needed. Do not use this branch on any production system.
Supervisor 4.0 (unreleased) is planned to work under Python 2 version 2.6 or greater and Python 3 version 3.2 or greater. See note above about the current state of Python 3 support.
So it is completely puzzling for us as to how aiohttp configuration was tested as mentioned in nginx+supervisord configuration section.
We also tried an alternative route, via ubuntu install:
sudo apt-get install supervisor
It installed supervisor 3.2.0-2ubuntu0.1. Then we tried to configure supervisor per config provided. It resulted in below output:
conf.d $ sudo service supervisor start
conf.d $ sudo 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 Wed 2017-06-14 12:00:18 IST; 4s ago
Docs: http://supervisord.org
Process: 7291 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
Process: 7283 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2)
Main PID: 7283 (code=exited, status=2)
Jun 14 12:00:18 nerd51-ThinkPad systemd[1]: supervisor.service: Unit entered failed state.
Jun 14 12:00:18 nerd51-ThinkPad systemd[1]: supervisor.service: Failed with result 'exit-code'.
To investigate further, we executed this command:
sudo /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
It resulted in,
Error: program section program:aiohttp does not specify a command in section 'program:aiohttp' (file: '/etc/supervisor/conf.d/supervisord_example.conf')
For help, use /usr/bin/supervisord -h
Then, we replaced cmd with command line with below line in the config file and restarted
command=/home/asinha/Development/learn/aiohttp_example.py --port=808%(process_num)s
The result:
conf.d $ sudo service supervisor start
conf.d $ sudo service supervisor status
โ supervisor.service - Supervisor process control system for UNIX
Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2017-06-14 12:23:52 IST; 1s ago
Docs: http://supervisord.org
Process: 8419 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
Main PID: 8455 (supervisord)
CGroup: /system.slice/supervisor.service
โโ8455 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
โโ8462 python3 /home/asinha/Development/learn/aiohttp_example.py --port=8082
โโ8463 python3 /home/asinha/Development/learn/aiohttp_example.py --port=8083
โโ8464 python3 /home/asinha/Development/learn/aiohttp_example.py --port=8081
โโ8465 python3 /home/asinha/Development/learn/aiohttp_example.py --port=8084
Jun 14 12:23:52 nerd51-ThinkPad systemd[1]: Started Supervisor process control system for UNIX.
Jun 14 12:23:52 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:52,479 CRIT Supervisor running as root (no user in config file)
Jun 14 12:23:52 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:52,479 WARN Included extra file "/etc/supervisor/conf.d/supervis
Jun 14 12:23:52 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:52,487 INFO RPC interface 'supervisor' initialized
Jun 14 12:23:52 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:52,487 CRIT Server 'unix_http_server' running without any HTTP a
Jun 14 12:23:52 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:52,487 INFO supervisord started with pid 8455
Jun 14 12:23:53 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:53,489 INFO spawned: 'example_2' with pid 8462
Jun 14 12:23:53 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:53,491 INFO spawned: 'example_3' with pid 8463
Jun 14 12:23:53 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:53,492 INFO spawned: 'example_1' with pid 8464
Jun 14 12:23:53 nerd51-ThinkPad supervisord[8455]: 2017-06-14 12:23:53,494 INFO spawned: 'example_4' with pid 8465
Hence, supervisord configuration must provide correct info in the doc.
Also, in the aiohttp server section, it will be beneficial to mention that,
Python 3.5.2, Ubuntu 16.04
The only thing what is actually wrong is using cmd instead of command.
Instructions for supervisord setup etc are out of aiohttp project scope.
People should need at least basic admin knowledge for making web server up and running.
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a [new issue] for
related bugs.
If you feel like there's important points made in this discussion,
please include those exceprts into that [new issue].