Mastra

phinneas
HOBBY

2 months 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

$10 Bounty

3 Replies

lofimit
HOBBY

2 months 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!

2 months ago

Confirming if this solution works


phinneas
HOBBY

2 months ago

Thanks for the help. It does not seem to have changed the outcome.

Starting Container

npm warn config production Use --omit=dev instead.

> my-ssc-chatbot-demo@1.0.0 start

> mastra start

Mastra CLI: 0.10.1

this is what i am receiving in the logs.


Mastra - Railway Help Station