The remote end closed the TCP connection mid-transfer (RST). In CI this is a transient network or upstream blip during a download, push, or API call, not a logic error.
What this error means
A network step fails with Connection reset by peer, ECONNRESET, or socket hang up. Re-running the unchanged job usually succeeds.
A load balancer or server reset an in-flight connection, often under load or during a brief restart.
Transient network instability
Packet loss or a brief path change can surface as a reset on the runner side.
How to fix it
Retry the interrupted transfer
Retries absorb a one-off reset.
shell
npm config set fetch-retries 5
npm ci
# or for git
git config --global http.lowSpeedLimit 1000
git config --global http.lowSpeedTime 30
Reduce stress on the connection
Lower download concurrency to ease pressure on the upstream.
Use a mirror/cache to shorten the path.
Authenticate to avoid throttling-induced resets.
How to prevent it
Configure retries for network operations.
Cache dependencies to reduce remote hits.
On managed runners, transient connection resets are detected and the job is automatically retried, so a one-off reset does not fail the build.
Frequently asked questions
What causes "ECONNRESET in CI"?
A load balancer or server reset an in-flight connection, often under load or during a brief restart.
How do I fix ECONNRESET in CI?
Retries absorb a one-off reset.
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.