R

Railway

βœ‹ο½œhelp

Join Server

Application failed to respond

Nnpmrunstart5/20/2023
My nx app get that error:

yarn run v1.22.19
$ nx serve app --prod --port 5564
> nx run app:serve:production --port 5564
info  - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5564


nix packs configuration:

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "yarn build app --prod"
  },
  "deploy": {
    "numReplicas": 1,
    "startCommand": "yarn start app --prod --port ${PORT-3001}",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}
Nnpmrunstart5/20/2023
32545448-aaa5-4244-804b-a690a9ace33d
Bbrody5/20/2023
can you try adding --host 0.0.0.0 to your start command?
Bbrody5/20/2023
before the port flag is used
Nnpmrunstart5/20/2023
Thanks @Brody, just tried and still not working
Bbrody5/20/2023
what status code do you get?
Bbrody5/20/2023
show me the new logs please
Nnpmrunstart5/20/2023
@Brody
Bbrody5/20/2023
show me the railway.json file
Nnpmrunstart5/20/2023
{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "yarn build app --prod"
  },
  "deploy": {
    "numReplicas": 1,
    "startCommand": "yarn start app --prod --port ${PORT-3001} --host=0.0.0.0",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}
Bbrody5/20/2023
try this?
Nnpmrunstart5/20/2023
Omg @Brody πŸ˜‚πŸ˜‚ thank you so much, you saved my night
Nnpmrunstart5/20/2023
Still not working @Brody

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "buildCommand": "yarn build app --prod"
  },
  "deploy": {
    "numReplicas": 1,
    "startCommand": "yarn start app --host 0.0.0.0 --port ${PORT-3001} --prod",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}


yarn run v1.22.19
$ nx serve app --host 0.0.0.0 --port 5438 --prod
> nx run app:serve:production --host 0.0.0.0 --port 5438
info  - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5438
Nnpmrunstart5/20/2023
Problem solved, should be: nx serve app --hostname 0.0.0.0 --port 5438 --prod πŸŽ‰πŸŽ‰
Bbrody5/20/2023
hehe I took a guess at --host, nx's docs page was frozen for me
Bbrody5/20/2023
glad you could solve it!