App deploys successfully but returns 502 Bad Gateway
portfedh
HOBBYOP

7 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

white_check_mark emoji 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

wrench emoji PORT detection: { envPORT: '8080', finalPORT: 8080, source: 'Railway env' }

wrench emoji Initializing server...

round_pushpin emoji Environment: development

globe_with_meridians emoji PORT: 8080 (Railway)

file_folder emoji File extension: JavaScript

rocket emoji Salsa Candela API running on port 8080

clipboard emoji Documentation: http://localhost:8080/api-docs

globe_with_meridians emoji Server bound to: 0.0.0.0:8080

white_check_mark emoji Server startup complete - Ready for connections

floppy_disk emoji Memory usage: { rss: '85MB', heapTotal: '34MB', heapUsed: '22MB', external: '3MB' }

arrows_counterclockwise emoji Process alive, uptime: 141 seconds

arrows_counterclockwise emoji 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

arrows_counterclockwise emoji Process alive, uptime: 10 seconds

arrows_counterclockwise emoji Process alive, uptime: 20 seconds

arrows_counterclockwise emoji Process alive, uptime: 30 seconds

arrows_counterclockwise emoji Process alive, uptime: 40 seconds

arrows_counterclockwise emoji Process alive, uptime: 50 seconds

arrows_counterclockwise emoji Process alive, uptime: 60 seconds

...

Solved$10 Bounty

1 Replies

Railway
BOT

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


Loading...