a year ago
Trying to start an app that worked previously. Haven't made a ton of changes I can imagine would break it, but who knows.
App logs when starting:
Apr 22 16:43:21
(Use node --trace-deprecation ... to show where the warning was created)
Apr 22 16:43:22
[23:43:22 UTC] INFO: Server listening at http://127.0.0.1:8080
Apr 22 16:43:22
[23:43:22 UTC] INFO: Server listening at http://10.250.11.222:8080
Apr 22 16:43:22
[23:43:22 UTC] INFO: Server listening at http://127.0.0.1:8080I can even confirm that something is running on 8080, cause if i ssh in and run npm run start I get an error: listen EADDRINUSE: address already in use 0.0.0.0:8080
However, trying to hit my unauthenticated endpoint /health never returns, it just spins, I see nothing in the http logs.
The project logs also shows something that doesn't look great:
npm error path /app
npm error command failed
npm error signal SIGTERM
npm error command sh -c node dist/server.js
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-04-22T23_00_33_650Z-debug-0.logBut any time I restart/redeploy and get this message, there is never anything at the location the message calls out.
Sometimes, there is also THIS line from the postgres database, which seems suspect:
2025-04-22 23:54:34.689 UTC [46] LOG: could not receive data from client: Connection reset by peer
But, I haven't changed the postgres connection settings. I can log into the postgres database from my local fine and run migrations.
I don't really know what to do to troubleshoot any further...the app locally starts with npm run start and the simple endpoint returns.
3 Replies
a year ago
Update - I tried switching to Railpack because I'm just out of options since it seems like no HTTP requests ever make it into server logs or my server, and I got a new message in the project logs:
npm error path /app
npm error command failed
npm error signal SIGTERM
npm error command sh -c node dist/server.js
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-04-23T14_30_06_535Z-debug-0.log
2025-04-23 15:51:58.125 UTC [924] LOG: could not receive data from client: Connection reset by peer
Stopping Container"Stopping Container" seems like something only output now because of Railpack - perhaps Nixpack code just doesn't output this message? - but it fits with the experience I'm having. Note that this log message happened without me doing anything (didn't redeploy, didn't modify variables, etc)
a year ago
Ughhhh ok. Figured it out. UX really confused me (see screenshot). This sure makes it look like my app should be connected to on port 8080 doesn't it? This is especially weird cause my app never specifies 8080 anywhere, so I assumed this was some default Railway uses, and, following what seemed like pretty clear instructions from this screenshot, I was going to http://my-bad.up.railway.app:8080....
Finally clicked the top part as a link and it went to normal HTTP port 80 in my browser and worked. Maybe I'm a dummy, but that UX is def a little confusing to me
Attachments
a year ago
Hey bporterfield,
8080 is the port that your service is binding to, not the port of the frontend proxy service. IE: Our Railway reverse proxy service will hit the target port of 8080 from your.domain.up.railway.app. HTTP/HTTPS will (almost) always go over 80/443, regardless of provider. (Unless you're doing something pretty odd)
You can read more about how public networking works here: https://docs.railway.com/reference/errors/application-failed-to-respond
Welcome in to Railway, glad to have you!
Status changed to Awaiting User Response Railway • 11 months ago
Status changed to Solved echohack • 11 months ago