a month ago
We are seeing intermittent outbound TCP connection failures from a Railway service in the US West region to an Alibaba Cloud Model Studio endpoint in Beijing.
Environment: production
Region: US West
Destination host:
ws-douf5b4ymvzf09du.cn-beijing.maas.aliyuncs.com
Port:
443
DNS resolution succeeds and returns both IPv4 and IPv6 records.
From the same deployed Railway container:
- https://example.com consistently returns HTTP 200
- requests to the Alibaba endpoint intermittently succeed and return HTTP 401 when unauthenticated
- other attempts fail during TCP connect with IPv4 ETIMEDOUT
- IPv6 connection attempts report ENETUNREACH
Example results:
- HTTP 401 in 1241 ms
- TCP connect failure in ~505 ms:
- IPv4: ETIMEDOUT
- IPv6: ENETUNREACH
- HTTP 401 in 223 ms
This appears to be an intermittent outbound connectivity/routing issue rather than a DNS or application configuration issue, since the same endpoint sometimes returns a valid HTTP response.
Could you please help investigate whether there are any outbound routing, IPv4, or IPv6 connectivity issues from Railway US West to this destination?
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
Based on the behavior you described, I’d try to isolate the issue by destination IP first.
Since the exact same endpoint sometimes returns HTTP 401 and other times fails with IPv4 ETIMEDOUT, the first step is to check whether the failures are tied to a specific IPv4 address returned by DNS.
You can start with:
getent ahostsv4 ws-douf5b4ymvzf09du.cn-beijing.maas.aliyuncs.comThen run multiple requests while logging the remote IP used for each connection:
for i in $(seq 1 30); do
curl -4 \
--connect-timeout 5 \
--max-time 10 \
-sS \
-o /dev/null \
-w 'IP=%{remote_ip} HTTP=%{http_code} CONNECT=%{time_connect}s TOTAL=%{time_total}s\n' \
https://ws-douf5b4ymvzf09du.cn-beijing.maas.aliyuncs.com/ \
|| echo "FAILED"
sleep 1
doneIf you notice that one destination IP consistently fails while another works, test each IP directly using --resolve:
curl -4 -v \
--connect-timeout 5 \
--resolve "ws-douf5b4ymvzf09du.cn-beijing.maas.aliyuncs.com:443:DESTINATION_IP" \
https://ws-douf5b4ymvzf09du.cn-beijing.maas.aliyuncs.com/That should help confirm whether the problem is tied to a specific Alibaba IP or route.
I wouldn’t focus too much on the IPv6 ENETUNREACH for now. The main issue to isolate is the intermittent IPv4 ETIMEDOUT.
If all IPv4 addresses fail randomly, I’d also run mtr or traceroute toward the destination IPs and record the exact UTC timestamps of the failures.
At that point, you should have enough information to open a Railway support ticket with useful evidence:
- exact UTC timestamps
- destination IP for each attempt
- which IPs succeed and which fail
- curl results
- MTR/traceroute results
- service region: US West
If the failures consistently follow one destination IP, it’s likely a route/backend-specific issue. If they happen randomly across all IPs, I’d suspect the Railway egress/NAT/upstream path instead.
One more useful test would be deploying the same service temporarily in another Railway region. If the Alibaba endpoint becomes stable there, that would strongly suggest the issue is specific to the US West outbound path.