10 days ago
I have a Node.js application (Mastra framework).
It's deployed as service SSC
in project responsible-smile
.
It consistently fails to start with a 502 Bad Gateway
error in HTTP logs.
The deployment logs show Mastra CLI: 0.10.1
and then nothing else, indicating an immediate, silent crash.
Project ID (56ce0ab8-9cac-4437-92aa-ddd4a68ecc84
) and the Service ID of your SSC
service.
I've tried deploying an "extreme simplification" (bare Hono server) and it still crashes silently.
The goal was to use Railway to learn to use SurrealDB, Mastra and Langfuse for a chatbot experiment. But I cannot get the basic Mastra app to work. Mastra is a typescript framework that can use Nodejs and that's what I setup.
There is also a git repo here: https://github.com/Phinneas/SSC
2 Replies
10 days ago
Hey, most likely your Mastra app is just binding to localhost (127.0.0.1) instead of 0.0.0.0, so Railway's proxy can't reach it and throws that 502.
Try adding host: '0.0.0.0' in your server config inside index.ts like this:
server: {
port: parseInt(process.env.PORT || '4112', 10),
host: '0.0.0.0', // added this line
},
Make sure to redeploy afterwards!
lofimit
Hey, most likely your Mastra app is just binding to localhost (127.0.0.1) instead of 0.0.0.0, so Railway's proxy can't reach it and throws that 502.Try adding host: '0.0.0.0' in your server config inside index.ts like this:server: {port: parseInt(process.env.PORT || '4112', 10),host: '0.0.0.0', // added this line},Make sure to redeploy afterwards!
6 days ago
Confirming if this solution works