App deploys successfully but returns 502 Bad Gateway
portfedh
PROOP

a year 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

a year 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 โ€ข about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...