7 months ago
I am deploying my project for the very first time. Although I don’t come from an app development background, I’ve been learning out of interest and successfully developed this app. I’ve uploaded the project to GitHub and am attempting to deploy it from there.
However, I’m encountering an issue where the app keeps crashing. The error log states: "Error: '$PORT' is not a valid port number." It seems that the $PORT
variable is currently blank. If anyone could assist me in resolving this issue and correctly deploying the app, I would greatly appreciate the help.
ⓘ Deployment information is only viewable by project members and Railway employees.
7 Replies
7 months ago
The linked service was deleted, this significantly hinders our ability to provide support.
But, this is likely what you need to read to overcome that error -
https://docs.railway.com/reference/build-and-start-commands#start-command
Specifically the section about wrapping your start command in a shell.
7 months ago
Hi Thank you so much. I removed the dockerfile and update that stat comman in setting but the app still crashes. It works perfectly fine in my localhost. Only when i comppleted working on it i uploaded it in github. I am not sure what the issue is whie deployment.
7 months ago
Since the original project was deleted, please provide a link to a new project.
7 months ago
https://railway.app/project/7bda2457-b446-4704-a190-fb4a0f1f1234 this is the project that i pulled again from github. Thank you so much
7 months ago
The setup lists python, yet the start command uses npm? can you help me to understand this?
Also, What python version are you using locally?
7 months ago
I am able to run the app now. However i am seeing issue with the postgresql. I have functionality to upload the data and it is stored in the database by the functions. Hoewver i am seeing this error ('danger', 'Error saving data to ratingmatrix: connection to server at "localhost" (::1), port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\nconnection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n') I checked if my code still has links with localhost but i dont see it in my config.py or app.py or .env. Could you please help me with this? thank you
7 months ago
The database on Railway is not accessable via localhost, you need to connect to the database that you are hosting on Railway.
Status changed to Solved brody • 7 months ago