3 months ago
I’m experiencing consistent 502 upstream headers response timeout errors when my Rust backend (Actix Web) makes external API calls that take 1.5–2.5 seconds to respond.
Railway seems to cut the connection after ~900ms, before my service can return headers — even though the request continues processing normally.
Example log:
{
"httpStatus": 502,
"path": "/api/purchase",
"totalDuration": 900057,
"upstreamRqDuration": 900001,
"upstreamErrors": "[{\"duration\":900001,\"error\":\"upstream headers response timeout\"}]"
}
However, other requests do succeed when they finish faster or when the container is warm:
{"httpStatus":200,"totalDuration":3182}
So the behavior is inconsistent: sometimes Railway allows >3s, sometimes it kills at ~0.9s.
My questions:
Does Railway enforce an undocumented ~900ms upstream header timeout?
Is this configurable in any plan?
Is there a recommended approach for backend services that rely on external APIs taking >1 second to respond?
Is this expected behavior or a platform limitation?
2 Replies
3 months ago
900000 ms is 15 minutes, your application needs to return at least the headers in under 15 minutes.
3 months ago
Going to close out this Discord thread as I see you already have a thread for this. Going forward, please avoid duplicate threads.
Status changed to Closed brody • 3 months ago