R
Railway17mo ago
lerchmo

Server Error (500)

I deployed a django application with a Procfile like web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn backend.wsgi:application I am getting a Server Error (500) page and no logs to indicate the cause. here is end of the deploy log. Kinda stuck here without any more info. [2023-05-10 23:23:08 +0000] [1] [INFO] Starting gunicorn 20.1.0 [2023-05-10 23:23:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:5537/ (1) [2023-05-10 23:23:08 +0000] [1] [INFO] Using worker: sync [2023-05-10 23:23:08 +0000] [11] [INFO] Booting worker with pid: 11
12 Replies
Percy
Percy17mo ago
Project ID: a3a7e1dd-9216-4c4b-8343-7a0a71894efd
lerchmo
lerchmo17mo ago
a3a7e1dd-9216-4c4b-8343-7a0a71894efd
Adam
Adam17mo ago
Looks like your app is starting, what port is your app listening on? It should be listening on the environment variable PORT No need to set it, Railway does that for you
lerchmo
lerchmo17mo ago
[2023-05-11 16:06:06 +0000] [1] [INFO] Starting gunicorn 20.1.0 [2023-05-11 16:06:06 +0000] [1] [INFO] Listening at: http://0.0.0.0:8060 (1) [2023-05-11 16:06:06 +0000] [1] [INFO] Using worker: sync [2023-05-11 16:06:06 +0000] [11] [INFO] Booting worker with pid: 11 it is listening to the $PORT environmental variable This is my startup script: web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn backend.wsgi:application --bind "0.0.0.0:${PORT}"
Brody
Brody17mo ago
there's a code issue here, please reference the railway django template https://github.com/railwayapp-starters/django
lerchmo
lerchmo17mo ago
How do I debug this? your logs show my application is running and I don't see error logs? but the front end is returning a 500 error
Brody
Brody17mo ago
add logging, obviously something has gone wrong but you aren't logging it or are you sure you are logging to stdout and stderr?
lerchmo
lerchmo17mo ago
so the issue was related to a specific django plugin that worked locally... but silently failed on your server. So I removed the plugin, now I have another silent error unrelated. frustrating experience might have nothing to do with your system but some kind of server error logs would be helpful
Brody
Brody17mo ago
you can view the logs in the logs tab, you just need to log to stdout and stderr check your debug level and make sure to log to stdout and stderr
lerchmo
lerchmo17mo ago
I turned DEBUG=True back on to see if it will work on production
Brody
Brody17mo ago
that's not what I meant but okay
lerchmo
lerchmo17mo ago
I got it working finally, some plugins were causing errors for whatever reason but I can live without them
Want results from more Discord servers?
Add your server