What you see
warning: spurious network error (3 tries remaining): [28] Timeout was reached (Operation timed out after 30000 milliseconds with 0 bytes received)Common causes
- Slow or unstable links to static.crates.io.
- Corporate proxies that Cargo is not configured for.
- Many crates downloaded in parallel on a constrained connection.
How to fix it
- 01
Retry more and wait longer
Cargo reads network settings from its config.
.cargo/config.toml [net] retry = 5 [http] timeout = 120 - 02
Configure a proxy
If the runner is behind a proxy, set it for Cargo.
.cargo/config.toml [http] proxy = "http://proxy.internal:3128" - 03
Replace crates.io with a regional cache
Source replacement keeps Cargo.lock unchanged.
.cargo/config.toml [registries.cacheport] index = "sparse+https://acme.cacheport.cc/cargo/index/" [source.crates-io] replace-with = "cacheport"