Open Niyibab opened 3 weeks ago
You are being told a module was not found:
ModuleNotFoundError: No module named 'flask'
What makes you think this is related to gunicorn? What steps have you completed to verify that the module is installed in that venv?
[2024-10-30 17:19:51 +0000] [3675] [INFO] Starting gunicorn 23.0.0 [2024-10-30 17:19:51 +0000] [3675] [INFO] Listening at: http://127.0.0.1:8000 (3675) [2024-10-30 17:19:51 +0000] [3675] [INFO] Using worker: sync [2024-10-30 17:19:51 +0000] [3676] [INFO] Booting worker with pid: 3676 [2024-10-30 17:19:51 +0000] [3676] [ERROR] Exception in worker process Traceback (most recent call last): File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker worker.init_process() File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 135, in init_process self.load_wsgi() File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi self.wsgi = self.app.wsgi() ^^^^^^^^^^^^^^^ File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 66, in wsgi self.callable = self.load() ^^^^^^^^^^^ File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 57, in load return self.load_wsgiapp() ^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp return util.import_app(self.app_uri) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/util.py", line 370, in import_app mod = importlib.import_module(module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/app.py", line 1, in
from flask import Flask, render_template, request
ModuleNotFoundError: No module named 'flask'
[2024-10-30 17:19:51 +0000] [3676] [INFO] Worker exiting (pid: 3676)
[2024-10-30 17:19:51 +0000] [3677] [INFO] Booting worker with pid: 3677
[2024-10-30 17:19:51 +0000] [3677] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
worker.init_process()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 135, in init_process
self.load_wsgi()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/util.py", line 370, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/app.py", line 1, in
from flask import Flask, render_template, request
ModuleNotFoundError: No module named 'flask'
[2024-10-30 17:19:51 +0000] [3677] [INFO] Worker exiting (pid: 3677)
[2024-10-30 17:19:51 +0000] [3678] [INFO] Booting worker with pid: 3678
[2024-10-30 17:19:51 +0000] [3678] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
worker.init_process()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 135, in init_process
self.load_wsgi()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/util.py", line 370, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/app.py", line 1, in
from flask import Flask, render_template, request
ModuleNotFoundError: No module named 'flask'
[2024-10-30 17:19:51 +0000] [3675] [ERROR] Worker (pid:3676) exited with code 3
[2024-10-30 17:19:51 +0000] [3678] [INFO] Worker exiting (pid: 3678)
[2024-10-30 17:19:51 +0000] [3675] [ERROR] Worker (pid:3677) was sent SIGTERM!
[2024-10-30 17:19:51 +0000] [3675] [ERROR] Worker (pid:3678) exited with code 3
Traceback (most recent call last):
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 201, in run
self.manage_workers()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 570, in manage_workers
self.spawn_workers()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 642, in spawn_workers
time.sleep(0.1 * random.random())
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 241, in handle_chld
self.reap_workers()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 529, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/bin/gunicorn", line 8, in
sys.exit(run())
^^^^^
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 66, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]", prog=prog).run()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 235, in run
super().run()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/app/base.py", line 71, in run
Arbiter(self).run()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 228, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 341, in halt
self.stop()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 395, in stop
time.sleep(0.1)
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 241, in handle_chld
self.reap_workers()
File "/home/ubuntu/myapp/Ai-project-1CS-/PROJECT/venv/lib/python3.12/site-packages/gunicorn/arbiter.py", line 529, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>