KaisVault Platform Backend Deployment Failing with 502 Error
richestment
HOBBYOP

3 months ago

Dear Railway Support Team,

I'm experiencing deployment issues with my Node.js/Express backend service on Railway. The deployment appears to complete successfully, but all endpoints return 502 Bad Gateway errors.

Project Details:

•  Service Name: kaisvault-platform-clean

•  Repository: https://github.com/richestment/kaisvault-platform-clean

•  Framework: Node.js 18+ with Express

•  Deployment URL: https://kaisvault-platform-clean-production.up.railway.app

Issue Description:

1. The GitHub repository is connected and deployments trigger automatically

2. Build process appears to complete without errors

3. All API endpoints return 502 Bad Gateway errors

4. Health check endpoint (/health) also returns 502

5. CONFIRMED: The service is not starting - Supabase logs show ZERO connection attempts from Railway

6. CONFIRMED: All external services (Supabase, Edge Functions) are working correctly

Current Configuration:

•  Start Command: Not explicitly set (should default to npm start from package.json)

•  Build Command: Not explicitly set (should default to npm install)

•  Node Version: >=18.0.0 (specified in package.json)

•  Port: Using process.env.PORT (Railway should auto-assign)

Environment Variables Set:

•  NODE_ENV = production

•  SUPABASE_URL = https://thghnoxknsydvigxstub.supabase.co

•  SUPABASE_SERVICE_ROLE_KEY = [JWT token starting with eyJ...]

•  FRONTEND_URL = https://kaisvault.com

•  BOT_SERVICE_URL = [configured]

•  HELIO_API_KEY = [configured]

•  HELIO_PUBLIC_KEY = [configured]

•  HELIO_WEBHOOK_SECRET = [configured]

•  HELIO_SIGNALS_LINK_ID = [configured]

•  HELIO_BASIC_LINK_ID = [configured]

•  HELIO_PRO_LINK_ID = [configured]

•  HELIO_ENTERPRISE_LINK_ID = [configured]

Package.json Scripts:

json

Main Dependencies:

{

  "scripts": {

    "start": "node server.js",

    "dev": "nodemon server.js"

  }

}

Main Dependencies:

•  express: ^4.18.2

•  @supabase/supabase-js: ^2.57.4

•  @solana/web3.js: ^1.87.6

•  cors: ^2.8.5

•  helmet: ^7.1.0

•  dotenv: ^16.3.1

What I've Tried:

1. Verified all environment variables are set in Railway dashboard

2. Confirmed the repository builds locally without issues

3. Tested the application locally with the same environment variables

4. Pushed multiple commits to trigger redeployments

5. Checked that server.js listens on 0.0.0.0 and uses process.env.PORT

6. Verified with Supabase support that NO connection attempts are reaching Supabase from Railway

7. Confirmed all Supabase Edge Functions are deployed and responding correctly

8. Tested Supabase connection locally - works perfectly with the same credentials

Expected Behavior:

•  The service should start and respond to HTTP requests

•  Health endpoint (/health) should return status 200 with JSON response

•  API endpoints should be accessible

Critical Finding:

Supabase support confirmed that NO connection attempts from my Railway deployment URL are appearing in their logs. This means the Node.js service is crashing or failing to start before it even attempts to connect to external services.

Questions:

1. Can you provide the full deployment/runtime logs? The service appears to crash on startup

2. Are there any deployment logs that show why the service is failing to start?

3. Is the service actually running but not accessible due to port binding issues?

4. Should I explicitly set the Start Command and Build Command in Railway settings?

5. Are there any known issues with Node.js 18+ deployments using Nixpacks?

6. Could this be related to memory/resource limits on my current plan?

7. Is there a startup timeout that might be killing the service?

Test Endpoints That Should Work:

•  GET https://kaisvault-platform-clean-production.up.railway.app/health

•  GET https://kaisvault-platform-clean-production.up.railway.app/api/status

•  GET https://kaisvault-platform-clean-production.up.railway.app/

Most Likely Causes:

1. Service is crashing during startup (before listening on PORT)

2. Missing or incorrectly formatted environment variable causing immediate crash

3. Node.js version incompatibility

4. Memory limit being exceeded during startup

5. Start command not being executed properly

Please help me identify what's preventing the service from starting. The issue is definitely on the Railway side as all external services are confirmed working. I urgently need access to the deployment logs to see the startup error.

Thank you for your assistance!

Best regards,

Sanem

Solved

2 Replies

Railway
BOT

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


richestment
HOBBYOP

3 months ago

this one is fixed! thank you guys ;)


Status changed to Awaiting Railway Response Railway 3 months ago


Status changed to Solved richestment 3 months ago


Loading...