I’m running a Django Web App – it’s working locally, and was deploying successfully to Azure.
I’m now seeing the following error on the logstream:
Traceback (most recent call last):
2024-05-03T06:02:12.640875058Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
2024-05-03T06:02:12.640878658Z worker.init_process()
2024-05-03T06:02:12.640881958Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
2024-05-03T06:02:12.640885158Z self.load_wsgi()
2024-05-03T06:02:12.640899358Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2024-05-03T06:02:12.640909259Z self.wsgi = self.app.wsgi()
2024-05-03T06:02:12.640912259Z ^^^^^^^^^^^^^^^
2024-05-03T06:02:12.640915159Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi
2024-05-03T06:02:12.640918359Z self.callable = self.load()
2024-05-03T06:02:12.640921359Z ^^^^^^^^^^^
2024-05-03T06:02:12.640924259Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2024-05-03T06:02:12.640927359Z return self.load_wsgiapp()
2024-05-03T06:02:12.640930759Z ^^^^^^^^^^^^^^^^^^^
2024-05-03T06:02:12.640933659Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2024-05-03T06:02:12.640936759Z return util.import_app(self.app_uri)
2024-05-03T06:02:12.640939659Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-03T06:02:12.640942759Z File "/home/site/wwwroot/antenv/lib/python3.11/site-packages/gunicorn/util.py", line 371, in import_app
2024-05-03T06:02:12.640945959Z mod = importlib.import_module(module)
2024-05-03T06:02:12.640948959Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-03T06:02:12.640952059Z File "/opt/python/3.11.8/lib/python3.11/importlib/__init__.py", line 126, in import_module
2024-05-03T06:02:12.640955059Z return _bootstrap._gcd_import(name[level:], package, level)
2024-05-03T06:02:12.640957959Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-03T06:02:12.640960859Z File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-05-03T06:02:12.640964759Z File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-05-03T06:02:12.640967959Z File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
2024-05-03T06:02:12.640971159Z File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-05-03T06:02:12.640974259Z File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-05-03T06:02:12.640977359Z File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-05-03T06:02:12.640980360Z File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
2024-05-03T06:02:12.640984160Z ModuleNotFoundError: No module named 'trplbackend'
This is my start up command:
gunicorn --bind=0.0.0.0 --timeout 600 trplbackend.wsgi:application
My project structure seems to be correct on inspection. Running this command locally also works.
I have inspected docker logs and tried re-deployment, although, nothing seems to be working. For context, in the past, my Azure Web App deployment has also been flaky.
Simply redeploying through Azure Pipelines with no changes seem to have worked.
Any ideas on how I can investigate or fix this error and make the deployment more robust?
Thank you.