App deploys successfully but returns 502 Bad Gateway
portfedh
PROOP

10 months ago

The problem:

- App starts and runs (see logs below)

- Binds to correct port 8080

- Railway's edge returns 502 with x-railway-fallback: true

- Request ID: Auq5DUFaQqCgfg9_g4a9AQ

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:

GZH_JtWRTfae6mGyg4a9AQ

Repo:

https://github.com/portfedh/mobile-backend

Logs:

Starting Container

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

> sc-mobile-backend@1.0.0 start

> node dist/app.js

Swagger spec loaded successfully

[dotenv@17.0.1] injecting env (0) from .env – [tip] encrypt with dotenvx: https://dotenvx.com

[dotenv@17.0.1] injecting env (0) from .env – [tip] encrypt with dotenvx: https://dotenvx.com

[dotenv@17.0.1] injecting env (0) from .env – [tip] encrypt with dotenvx: https://dotenvx.com

πŸ”§ PORT detection: { envPORT: '8080', finalPORT: 8080, source: 'Railway env' }

πŸ”§ Initializing server...

πŸ“ Environment: development

🌐 PORT: 8080 (Railway)

πŸ“ File extension: JavaScript

πŸš€ Salsa Candela API running on port 8080

πŸ“‹ Documentation: http://localhost:8080/api-docs

🌐 Server bound to: 0.0.0.0:8080

Server startup complete - Ready for connections

πŸ’Ύ Memory usage: { rss: '85MB', heapTotal: '34MB', heapUsed: '22MB', external: '3MB' }

πŸ”„ Process alive, uptime: 141 seconds

πŸ”„ Process alive, uptime: 151 seconds

npm error path /app

npm error command failed

npm error signal SIGTERM

npm error command sh -c node dist/app.js

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-08-13T21_46_51_540Z-debug-0.log

Stopping Container

πŸ”„ Process alive, uptime: 10 seconds

πŸ”„ Process alive, uptime: 20 seconds

πŸ”„ Process alive, uptime: 30 seconds

πŸ”„ Process alive, uptime: 40 seconds

πŸ”„ Process alive, uptime: 50 seconds

πŸ”„ Process alive, uptime: 60 seconds

...

Solved$10 Bounty

1 Replies

Railway
BOT

10 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Status changed to Solved portfedh β€’ 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...