#17543·cargo

Cargo HTTP downloads stall with 0 bytes on macOS while curl downloads the same crate successfully

Author: urielromeoCreated Sep 30, 2026Updated Sep 30, 2026
LabelsC-bugA-networkingS-triage

Problem

Cargo HTTP downloads stall with 0 bytes on macOS while curl downloads the same crate successfully

Problem

cargo fetch is unable to download crates from static.crates.io on my machine.

Cargo repeatedly reports:

warning: spurious network error (3 tries remaining): transfer too slow: failed to transfer more than 10 bytes in 60s (transferred 0 bytes)

and eventually:

error: failed to download from `https://static.crates.io/crates/rayon/1.7.0/download`

Caused by:
  transfer too slow: failed to transfer more than 10 bytes in 60s (transferred 0 bytes)

However, downloading crate URLs directly using /usr/bin/curl works normally.

For example, downloading a crate directly from static.crates.io succeeds immediately.

Normal internet access is working, and system Git can also download the crates.io Git index at normal speed (~13 MB/s).

Cargo version

cargo 1.98.1 (797e8a9bc 2026-08-05)
release: 1.98.1
commit-hash: 797e8a9bca276c1c9f9f738d2a20f484fa4eea9d
commit-date: 2026-08-05
host: aarch64-apple-darwin
libgit2: 1.9.4 (sys:0.21.0 vendored)
libcurl: 8.7.1 (sys:0.4.90+curl-8.21.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.6.3 9 Jun 2026
os: Mac OS 26.7.0 [64-bit]

Hardware is Apple Silicon.

Things I tested

Direct requests to the crates.io sparse index using curl work.

Direct downloads from static.crates.io using /usr/bin/curl also work.

I also tried:

bash
CARGO_HTTP_IPRESOLVE=4 \
CARGO_HTTP_MULTIPLEXING=false \
CARGO_HTTP_TIMEOUT=60 \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git \
CARGO_NET_GIT_FETCH_WITH_CLI=true \
cargo fetch -vv

The crate HTTP downloads still stall at 0 bytes.

Interestingly, Cargo's built-in Git fetching also had connection problems. Switching to:

bash
CARGO_NET_GIT_FETCH_WITH_CLI=true

allowed the crates.io Git index to download successfully using system Git (~431 MB at approximately 13 MB/s).

The failure therefore appears specific to networking performed internally by Cargo rather than general connectivity to GitHub/crates.io.

Expected behavior

cargo fetch should download the crates successfully, as /usr/bin/curl can download the same URLs from the same machine and network.

Additional information

DNS resolution, TLS connections, normal HTTPS traffic, and system Git all work normally.

Changing DNS did not affect the issue.

Forcing IPv4, disabling Cargo HTTP multiplexing, increasing the timeout, and lowering the low-speed limit did not resolve it.

I initially encountered similar network stalls while attempting to install Rust through rustup, although Rust/Cargo are now installed from the official standalone aarch64-apple-darwin distribution.

Steps

Steps to reproduce

  1. On macOS 26.7 (Apple Silicon), using Cargo 1.98.1, create a new Rust project:
bash
cargo new cargo-network-test
cd cargo-network-test
  1. Add a dependency to Cargo.toml, for example:
toml
[dependencies]
rayon = "1.7.0"
  1. Run:
bash
cargo fetch -vv
  1. Cargo attempts to download the crate from static.crates.io, but eventually reports:
warning: spurious network error (3 tries remaining):
transfer too slow: failed to transfer more than 10 bytes in 30s (transferred 0 bytes)

and ultimately fails with:

error: failed to download from `https://static.crates.io/crates/rayon/1.7.0/download`

Caused by:
  transfer too slow: failed to transfer more than 10 bytes in 30s (transferred 0 bytes)
  1. Download the exact URL reported by Cargo using the system curl:
bash
/usr/bin/curl -L \
  https://static.crates.io/crates/rayon/1.7.0/download \
  -o /tmp/rayon-1.7.0.crate
  1. The download completes successfully.

The issue is reproducible even when running Cargo with:

bash
CARGO_HTTP_IPRESOLVE=4 \
CARGO_HTTP_MULTIPLEXING=false \
CARGO_HTTP_TIMEOUT=60 \
cargo fetch -vv

Cargo continues to report 0 bytes transferred, while /usr/bin/curl can download the same resource successfully.

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.98.1 (797e8a9bc 2026-08-05)
release: 1.98.1
commit-hash: 797e8a9bca276c1c9f9f738d2a20f484fa4eea9d
commit-date: 2026-08-05
host: aarch64-apple-darwin
libgit2: 1.9.4 (sys:0.21.0 vendored)
libcurl: 8.7.1 (sys:0.4.90+curl-8.21.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.6.3 9 Jun 2026
os: Mac OS 26.7.0 [64-bit]