Django app continually crashes on deployment
I'm trying to deploy a Django app with a PostgreSQL database. I set up the database first and it worked fine with my project on localhost. However, the build on railway continually crashes. I've tried several different versions of settings.py in an attempt to get the thing to work but without success. Project url = https://railway.app/project/c48d6936-0d11-4a4b-9c12-60d29a447416
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
4 Replies
drop error messages if any
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/opt/venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/opt/venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/opt/venv/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/opt/venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/opt/venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/opt/venv/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/nix/store/dcy4s05wgyznzcvghsm1sgbf7a0xrp8k-python3-3.9.13/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/app/project/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/opt/venv/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/opt/venv/lib/python3.9/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/venv/lib/python3.9/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/opt/venv/lib/python3.9/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
File "/nix/store/dcy4s05wgyznzcvghsm1sgbf7a0xrp8k-python3-3.9.13/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/app/risk_app/models.py", line 1, in <module>
from asyncio.windows_events import NULL
File "/nix/store/dcy4s05wgyznzcvghsm1sgbf7a0xrp8k-python3-3.9.13/lib/python3.9/asyncio/windows_events.py", line 6, in <module>
raise ImportError('win32 only')
ImportError: win32 only
[2022-10-17 14:43:23 +0000] [9] [INFO] Worker exiting (pid: 9)
[2022-10-17 14:43:23 +0000] [1] [INFO] Shutting down: Master
[2022-10-17 14:43:23 +0000] [1] [INFO] Reason: Worker failed to boot.
yeah so for whatever reason asyncio is trying to do something that is only supported on windows
ah
i see now
from asyncio.windows_events import NULL
in /app/risk_app/models.py
you must have accidentally imported thatOk thanks very much!