this is what my Emergent says
liverichtravel
PROOP

8 months ago

rotating_light emoji THE ROOT PROBLEM IS RAILWAY BACKEND - IT'S COMPLETELY BROKEN

x emoji Current Status:

  • white_check_mark emoji Frontend works perfectly (calls correct URL)

  • white_check_mark emoji CORS error is actually a GOOD sign (means frontend is trying to connect)

  • x emojiRailway backend returns 502 "Application failed to respond"

  • x emoji Railway shows "deployed successfully" but doesn't actually work

dart emoji THE REAL ISSUE:

Railway backend is completely non-functional. It's not a CORS issue - it's that Railway isn't serving any content at all.

You have 3 choices:

  1. Fix Railway (requires MongoDB Atlas connection string update)

  2. Deploy to different platform (Heroku, Render, DigitalOcean)

  3. Use working local backend temporarily while fixing Railway

Your staff can't use it because Railway backend is 100% broken, not because of frontend issues.

What do you want to do - fix Railway or deploy elsewhere?

it's been days now

$10 Bounty

4 Replies

Railway
BOT

8 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!


liverichtravel
PROOP

8 months ago

clipboard emoji COMPLETE PROBLEM EXPLANATION FOR RAILWAY SUPPORT

rotating_light emoji THE FULL ISSUE:

Project: LiveRich Video Organizer (Python FastAPI + React Frontend)
Problem: Railway backend deployment shows "successful" but returns 502 errors for ALL endpoints Duration: 9+ days of troubleshooting Impact: Production app completely non-functional, staff cannot use application

bar_chart emoji DETAILED TECHNICAL STATUS:

white_check_mark emoji WORKING COMPONENTS:

  • Frontend (Vercel): Deployed successfully, calls correct Railway URL

  • Local Development: Backend runs perfectly on localhost with full functionality

  • MongoDB Atlas: Database created and connection string available

  • Google OAuth: Credentials configured and working locally

x emoji BROKEN COMPONENT:

  • Railway Backend: Shows "deployed successfully" but completely non-responsive

mag emoji SPECIFIC ERROR PATTERN:

Every API endpoint returns identical error:

curl https://liverichvideoorganizer-production.up.railway.app/api/system/health
# Response: {"status":"error","code":502,"message":"Application failed to respond"}

curl https://liverichvideoorganizer-production.up.railway.app/health  
# Response: {"status":"error","code":502,"message":"Application failed to respond"}

curl https://liverichvideoorganizer-production.up.railway.app/
# Response: {"status":"error","code":502,"message":"Application failed to respond"}

📋 RAILWAY DEPLOYMENT DETAILS:

  • Repository: GitHub integration, auto-deploy from main branch

  • Build: Dockerfile-based, builds successfully (no errors)

  • Health Check: Shows as passing in Railway dashboard

  • Logs: Show "Uvicorn running on http://0.0.0.0:8080" but external requests fail

  • Start Command: sh -c "cd backend && python -m uvicorn server:app --host 0.0.0.0 --port ${PORT:-8000}"

dart emoji CORE ISSUE:

Railway's internal container appears to start successfully, but the external gateway/proxy cannot communicate with the container, resulting in 502 "Application failed to respond" for all requests.

bulb emoji SUSPECTED ROOT CAUSES:

  1. Port binding mismatch between container and Railway gateway

  2. Health check configuration not aligned with actual application endpoints

  3. Environment variable issues preventing proper startup

  4. Railway infrastructure issue with proxy/load balancer

Request: Need Railway engineering team to investigate why external gateway cannot reach successfully deployed container.


idiegea21
HOBBY

8 months ago

In your Railway project’s environment variables, ensure PORT is NOT manually set. Railway sets it automatically. Manually setting it may cause conflicts like this.

python -m uvicorn server:app --host 0.0.0.0 --port ${PORT:-8000}

so,technically the above is fine as long as the env var PORT is actually set by Railway.

Also,Check Your FastAPI App Path and make sure that server.py exists in the expected location. and Confirm it contain:

from fastapi import FastAPI
app = FastAPI()

idiegea21
HOBBY

8 months ago

you could also confiem that Railway is injecting the correct port at runtime. by logging the port

import os
print("Starting FastAPI on port:", os.environ.get("PORT"))

Loading...