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!
No description
Solution:
or in your code where you use the port:
const port = process.env.PORT || process.env.REACT_APP_PORT || 3000
const port = process.env.PORT || process.env.REACT_APP_PORT || 3000
...
Jump to solution
15 Replies
Percy
Percy13mo ago
Project ID: eb74066d-bfb0-4fc5-9d08-6d52e7554389
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
eb74066d-bfb0-4fc5-9d08-6d52e7554389
Fragly
Fragly13mo ago
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-errors
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
i 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
Fragly
Fragly13mo ago
is that in your env file?
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
yes
Fragly
Fragly13mo ago
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
Fragly
Fragly13mo ago
or in your code where you use the port:
const port = process.env.PORT || process.env.REACT_APP_PORT || 3000
const port = process.env.PORT || process.env.REACT_APP_PORT || 3000
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
so railway sets networking according to port varibale i provide?
Fragly
Fragly13mo ago
yea and if no PORT variable is set then it'll set one for you
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
ok then adding one extra line should work let me check
Brody
Brody13mo ago
is this a create react app?
Rahat Bin Taleb
Rahat Bin Taleb13mo ago
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
Brody
Brody13mo ago
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
Fragly
Fragly13mo ago
o7 okay
Want results from more Discord servers?
Add your server