a month ago
Hello,
I am pretty new to Railway and have been unable to fix the following 502 bad gateway error.
Application failed to respond
This error appears to be caused by the application.
If this is your project, check out your deploy logs to see what went wrong. Refer to our docs on Fixing Common Errors for help, or reach out over our Help Station.
If you are a visitor, please contact the application owner or try again later.
Request ID:
qvJrjvqnTV-2tuL8O8poTA
The build/deploy logs are clean. Please help!
Pinned Solution
a month ago
Try logging the variable your application is listening on console.log(process.env.PORT) for example, and map that port to your URL in service settings > networking.
7 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 27 days ago
a month ago
Make sure your application is listening on the same port your URL is mapped to.
a month ago
Good morning. I have genealogy software. Java 21 and MySQL 8 configuration. I can't put it in the cloud. Thank you. Jose
darseen
Make sure your application is listening on the same port your URL is mapped to.
a month ago
I am semi-certain that I did so, however, the error persists. I've got the port mapped to $PORT variable. Is that correct?
a month ago
make sure your app listening to address 0.0.0.0 instead of localhost or 127.0.0.1
fleurelle
I am semi-certain that I did so, however, the error persists. I've got the port mapped to $PORT variable. Is that correct?
a month ago
Try logging the variable your application is listening on console.log(process.env.PORT) for example, and map that port to your URL in service settings > networking.
carcacena
Good morning. I have genealogy software. Java 21 and MySQL 8 configuration. I can't put it in the cloud. Thank you. Jose
a month ago
Please create your own thread.
darseen
Try logging the variable your application is listening on `console.log(process.env.PORT)` for example, and map that port to your URL in service settings > networking.
a month ago
It worked! Thank you!
Status changed to Solved 0x5b62656e5d • 25 days ago

