Error: "PORT variable must be integer between 0 and 65535"

molhokwaiTRIAL

a year ago

Hello,
First time user, deploying a Django app, and getting the "PORT variable must be integer between 0 and 65535" error, even after hard coding the db port setting (and others)…

Can you please help solve this ?
Thanks

3 Replies

a year ago

what's your current start command and how and where are you setting it?


molhokwaiTRIAL

a year ago

Hello,
Getting the "Deployment Failed during build process" error, so during deployment.
Is the "PORT variable must be integer between 0 and 65535" error related to the Postgres port number, even though it's now a hardcoded integer in the settings file ?

My startup.sh command code:

#!/bin/bash
python manage.py collectstatic && gunicorn --workers 2 myproject.wsgi

a year ago

the PORT environment variable has nothing to do with postgres, it's an environment variable that Railway expects your app to be listening on.

I don't see you referencing that environment variable anywhere in your start command, making me believe you are overwriting your start command by setting it elsewhere, like in the service settings.

if you're using nixpacks look, at the top of the build logs, it will show you what start command the deployment will use, make sure it's the start command you desire.


Error: "PORT variable must be integer between 0 and 65535" - Railway Help Station