maxSIMhealth / GEN

Gamified Educational Network
GNU Affero General Public License v3.0
4 stars 3 forks source link

Deployment: gunicorn failing to initialize #461

Closed andreibosco closed 2 years ago

andreibosco commented 2 years ago

Deployment on Digital Ocean App Platform is failing, with gunicorn returning the following message:

gen 2022-09-19T03:12:09.927768511Z   File "/env/lib/python3.10/site-packages/gunicorn/workers/workertmp.py", line 46, in notify
gen 2022-09-19T03:12:09.927771389Z     os.fchmod(self._tmp.fileno(), self.spinner)
gen 2022-09-19T03:12:09.927773796Z PermissionError: [Errno 1] Operation not permitted
gen 2022-09-19T03:12:09.927780790Z [2022-09-19 03:12:09 +0000] [63] [INFO] Worker exiting (pid: 63)
andreibosco commented 2 years ago

This issue is only happening on Digital Ocean App Platform. Gen-MLT was deployed successfully on Kubernetes Cluster.

andreibosco commented 2 years ago

Got in touch with Digital Ocean Support, and they have suggested the following:

This is a known issue with Gunicorn running in Docker in general.
The fix is to configure gunicorn to use a different location for its temp files by passing this option to the run command:
gunicorn --worker-tmp-dir /dev/shm project.wsgi
andreibosco commented 2 years ago

Looks like the fix provided by Digital Ocean Support was effective. Dockerfile (deployment) and docker-compose.yml (development) were updated accordingly.