Запуск сервиса в RHEL7 дает статус = 1 / НЕИСПРАВНОСТЬ - PullRequest
0 голосов
/ 10 марта 2020

Я пытаюсь развернуть приложение Flask в экземпляре RHEL 7 EC2. Я хочу настроить приложение с Gunicorn и Nginx. Я следую этому учебнику. После настройки Gunicorn и запуска службы я получаю статус = 1 / FAILURE . Где я тут не прав? (Пожалуйста, укажите, нужна ли дополнительная информация для выявления проблемы).

vectorbot.service

[Unit]
Description=Gunicorn instance to serve vectorbot
After=network.target

[Service]
User=ec2-user
Group=ec2-user
WorkingDirectory=/home/ec2-user/projects/vectorbot
Environment="PATH=/home/ec2-user/projects/vectorbot/venv/bin"
ExecStart=/home/ec2-user/projects/vectorbot/venv/bin/gunicorn --workers 3 --bind unix:vectorbot.sock -m 007 wsgi:app

[Install]
WantedBy=multi-user.target

статус sudo systemctl -l vectorbot

● vectorbot.service - Gunicorn instance to serve vectorbot
   Loaded: loaded (/etc/systemd/system/vectorbot.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-03-10 12:52:33 +0530; 10min ago
 Main PID: 9202 (code=exited, status=1/FAILURE)

Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: time.sleep(0.1)
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: self.reap_workers()
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
Mar 10 12:52:32 ########.ec2.internal gunicorn[9202]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Mar 10 12:52:32 ########.ec2.internal systemd[1]: vectorbot.service: main process exited, code=exited, status=1/FAILURE
Mar 10 12:52:33 ########.ec2.internal systemd[1]: Unit vectorbot.service entered failed state.
Mar 10 12:52:33 ########.ec2.internal systemd[1]: vectorbot.service failed.

journalctl - u vectorbot.service

Mar 10 14:11:12 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:12 +0530] [13218] [INFO] Starting gunicorn 20.0.4
Mar 10 14:11:12 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:12 +0530] [13218] [INFO] Listening at: unix:vectorbot.sock (1321
Mar 10 14:11:12 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:12 +0530] [13218] [INFO] Using worker: sync
Mar 10 14:11:12 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:12 +0530] [13221] [INFO] Booting worker with pid: 13221
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:13 +0530] [13222] [INFO] Booting worker with pid: 13222
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:13 +0530] [13224] [INFO] Booting worker with pid: 13224
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:13 +0530] [13221] [ERROR] Exception in worker process
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: Traceback (most recent call last):
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: worker.init_process()
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: self.load_wsgi()
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: self.wsgi = self.app.wsgi()
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: self.callable = self.load()
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: return self.load_wsgiapp()
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: return util.import_app(self.app_uri)
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: mod = importlib.import_module(module)
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: return _bootstrap._gcd_import(name[level:], package, level)
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/wsgi.py", line 1, in <module>
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: from expose import app
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/expose.py", line 12, in <module>
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: si_data_vec = plyvel.DB('/home/ec2-user/projects/vectorbot/levelDB/si_data_vec', c
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "plyvel/_plyvel.pyx", line 247, in plyvel._plyvel.DB.__init__
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: File "plyvel/_plyvel.pyx", line 88, in plyvel._plyvel.raise_for_status
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: plyvel._plyvel.IOError: b'IO error: lock /home/ec2-user/projects/vectorbot/levelDB
Mar 10 14:11:13 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:13 +0530] [13221] [INFO] Worker exiting (pid: 13221)
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:14 +0530] [13224] [ERROR] Exception in worker process
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: Traceback (most recent call last):
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: worker.init_process()
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: self.load_wsgi()
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: self.wsgi = self.app.wsgi()
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: self.callable = self.load()
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: return self.load_wsgiapp()
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: return util.import_app(self.app_uri)
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/venv/lib/python3.6/site-packages/gunicorn/
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: mod = importlib.import_module(module)
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: return _bootstrap._gcd_import(name[level:], package, level)
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/wsgi.py", line 1, in <module>
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: from expose import app
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "/home/ec2-user/projects/vectorbot/expose.py", line 12, in <module>
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: si_data_vec = plyvel.DB('/home/ec2-user/projects/vectorbot/levelDB/si_data_vec', c
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "plyvel/_plyvel.pyx", line 247, in plyvel._plyvel.DB.__init__
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: File "plyvel/_plyvel.pyx", line 88, in plyvel._plyvel.raise_for_status
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: plyvel._plyvel.IOError: b'IO error: lock /home/ec2-user/projects/vectorbot/levelDB
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:14 +0530] [13224] [INFO] Worker exiting (pid: 13224)
Mar 10 14:11:14 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:14 +0530] [13222] [INFO] Worker exiting (pid: 13222)
Mar 10 14:11:15 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:15 +0530] [13218] [INFO] Shutting down: Master
Mar 10 14:11:15 ip-#######.ec2.internal gunicorn[13218]: [2020-03-10 14:11:15 +0530] [13218] [INFO] Reason: Worker failed to boot.
Mar 10 14:11:15 ip-#######.ec2.internal systemd[1]: vectorbot.service: main process exited, code=exited, status=3/NOTIMPLEMENTED
Mar 10 14:11:15 ip-#######.ec2.internal systemd[1]: Unit vectorbot.service entered failed state.
Mar 10 14:11:15 ip-#######.ec2.internal systemd[1]: vectorbot.service failed.
...