Unexpected Server Down for no reason!
I succesfully deployed my app in railway tomorrow! But suddenly it got unactive and saying server down! I thought maybe it's something related to my side ! But no ! everything is perfect and log are also fine but it couldn't spin the server maybe for some reason!
15 Replies
Project ID:
eb74066d-bfb0-4fc5-9d08-6d52e7554389
eb74066d-bfb0-4fc5-9d08-6d52e7554389
the 503 error normally happens when you're not using the correct ports or host IP
make sure you're using the PORT railway provided (
env.PORT
)
for more info:
https://docs.railway.app/troubleshoot/fixing-common-errorsi was using REACT_APP_PORT
MONGO_URL=bla bla
REACT_APP_ENV=prod
REACT_APP_SERVER_PORT=5000
REACT_APP_PORT=5000
I need these 4 varibales to use to make my aplication run
is that in your env file?
yes
yea, you need to use the PORT railway provides ( or at least set it manually )
try adding
PORT=5000
at the bottom of your env in railway
or just use env.PORT
instead of REACT_APP_PORT
Solution
or in your code where you use the port:
so railway sets networking according to port varibale i provide?
yea
and if no PORT variable is set then it'll set one for you
ok then adding one extra line should work let me check
is this a create react app?
no express app serving react build files statically
REACT_APP_ENV=prod
REACT_APP_SERVER_PORT=5000
REACT_APP_PORT=5000
PORT=5000
tried still giving server error
even i try t deploy my last commit that worked at night still gives error
please read https://docs.railway.app/troubleshoot/fixing-common-errors
fragly, anytime you see a 503 / application failed to respond thread, just send that link
okay