Skip to content
Latchkey

CI "Connection timed out" - Fix Network Timeouts on Runners

A connection attempt or transfer did not complete within the allotted time. The name resolved and the packets went out, but no timely response came back - a hallmark transient network failure.

What this error means

A download, clone, or API call hangs and then fails with Connection timed out, ETIMEDOUT, or curl: (28) Operation timed out. Re-running the job usually succeeds with no change.

CI log
curl: (28) Failed to connect to api.example.com port 443 after 30002 ms:
Connection timed out
# or
Error: connect ETIMEDOUT 140.82.112.3:443

Common causes

Transient network congestion or upstream slowness

A congested link or a briefly overloaded remote made the connection exceed its timeout. Nothing is wrong with the build - the network blipped.

A timeout that is too short for the transfer

Large downloads over a slow link can exceed a default client timeout even when the connection is healthy, producing a timeout that is really a slowness problem.

How to fix it

Retry with backoff

Transient timeouts almost always clear on a clean retry.

Terminal
curl --retry 5 --retry-delay 2 --retry-all-errors -fSL "$URL" -o out
# or wrap any command in a retry loop

Raise timeouts and reduce external calls

  1. Increase the client connect/read timeout for large transfers.
  2. Cache or mirror dependencies so fewer external connections are needed.
  3. Pull from a geographically closer mirror to cut round-trip latency.

How to prevent it

  • Wrap network steps in bounded retry-with-backoff.
  • Cache/mirror dependencies to reduce external connections.
  • Set realistic timeouts for the size of the transfers.

Frequently asked questions

What causes ""Connection timed out""?
A congested link or a briefly overloaded remote made the connection exceed its timeout. Nothing is wrong with the build - the network blipped.
How do I fix "Connection timed out"?
Transient timeouts almost always clear on a clean retry.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card