Edge router issues can't seem to connect with edge browser intermittently
lightsofapollo
PROOP

2 months ago

After deploying intermittently can't connect to my deployment with a browser (curl seems to work) seems like edge router issue.

I have other railway deployments without this issue and when I tired to instrument it I don't even see the logs for these hanging requests in my app... they seem to be stuck in the edge layer.

I find this very suspicious as when I curl the same url (say https://staging.gpu-cli.sh/auth/cli) I get an immedaite response and see it log in my console .

$30 Bounty

3 Replies

lightsofapollo
PROOP

2 months ago

I suspect this is still something I am doing wrong I am just not sure how to gather more information to find the root cause.


2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 2 months ago


yusufmo1
PRO

2 months ago

this sounds like an http/2 connection reuse issue between the browser and railway's edge proxy. curl defaults to http/1.1 and makes fresh connections, while browsers maintain persistent http/2 connections and multiplex requests over them. when those connections go stale or the edge proxy drops them without the browser knowing, subsequent requests hang waiting on a dead connection. you can verify this by opening devtools network tab, right-clicking and enabling "connection id" column - if hanging requests share the same connection id as earlier successful ones, that's your culprit.

a few things to try: check if your app is sending any connection-specific headers like Connection, Keep-Alive, or Transfer-Encoding - these are prohibited in http/2 and safari will straight up reject responses containing them while chrome/firefox just ignore them (could explain intermittent behavior across browsers). also check the Server header in your responses - if it says railway-edge you're on the new proxy. there have been reports of the edge proxy having issues with connection persistence, especially with larger payloads or after connections idle for ~60 seconds.

for debugging, try forcing http/1.1 in your browser (chrome://flags -> disable http/2) and see if the issue goes away. if it does, you've confirmed the http/2 root cause and can work with railway support from there. also worth checking if this happens more after the connection has been idle for a bit vs fresh page loads.


lightsofapollo

I suspect this is still something I am doing wrong I am just not sure how to gather more information to find the root cause.

ilyassbreth
FREE

2 months ago

if your app is sending connection: keep-alive or keep-alive headers in responses. these are forbidden in http/2 and safari will drop the connection when it sees them (chrome/firefox just ignore them which is why it's intermittent)

curl works because it uses http/1.1 where those headers are fine. requests hang at the edge proxy layer which is why you don't see logs

to fix this remove connection, keep-alive, and transfer-encoding headers from your app responses. check your server config or middleware - gunicorn, uvicorn, express middleware etc often add these automatically. once you strip them safari will stop hanging

verify by checking response headers in devtools or testing with safari specifically since it's the strictest about http/2 spec


Loading...