a month ago
I'm a UHF Pro subscriber and I'm trying to set up Cloud DVR using Railway.
The Railway deployment completes successfully and the server is created correctly.
Railway project details:
• Server deployed successfully
• Volume attached
• Port 8080 configured
• Service online
• Railway URL created
However, UHF never completes the connection process and loops back to the DVR setup screen.
The UHF debug logs show:
/auth/login 502 upstream error
Data is corrupted. The given data was not valid JSON.
Key 'idToken' was not found in JSON.
The server URL is:
https://uhf-server-production-a647.up.railway.app
It appears the UHF app is reaching the server, but the login endpoint is returning a 502 error instead of a valid response containing an idToken.
Could you please help determine whether this is a Railway deployment issue or a bug with the current UHF server image?
1 Replies
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
17:08
This is most likely a misconfigured environment variable issue, not a Railway infrastructure problem. The 502 on /auth/login means the server is running but crashing/failing on that specific request.
Most likely causes & fixes:
- Missing or wrong environment variables The idToken not found in JSON suggests the auth service isn't connecting to its backend (Firebase/Google Auth or similar). Check that all required env vars are set in Railway → Variables tab. Common ones for UHF DVR:
JWT_SECRET
Any Firebase/auth credentials
BASE_URL or SERVER_URL pointing to itself
-
PORT mismatch You have port 8080 configured — make sure the app inside the container is actually listening on 8080 and that PORT=8080 is set as an environment variable. Railway injects PORT automatically, but the app must use it.
-
Volume mount interfering with startup If the attached volume is mounted over a directory the app needs on startup, it can corrupt the initial state. Try temporarily detaching the volume and redeploying to see if login works.
-
Check Railway logs during login attempt Go to Railway → your service → Logs → trigger a login attempt and look for the actual crash/error message. The 502 is a symptom — the real error will be in the logs.
Bottom line: This is almost certainly a configuration issue (missing env vars or PORT mismatch), not a Railway bug. Start by checking the logs during a login attempt — that will pinpoint the exact cause.