Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network timeouts and freezing during cargo fetch #12525

Closed
babinskiy opened this issue Aug 18, 2023 · 3 comments
Closed

Network timeouts and freezing during cargo fetch #12525

babinskiy opened this issue Aug 18, 2023 · 3 comments
Labels
A-networking Area: networking issues, curl, etc. C-bug Category: bug S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@babinskiy
Copy link

babinskiy commented Aug 18, 2023

Problem

I encountered an issue while running Cargo on a repository with a large number of dependencies (1k+). The problem occurs during the execution of "cargo fetch" command, where the process initially runs smoothly but eventually freezes, leading to network timeouts. This issue started to occur after migrating from rust-toolchain version 1.65 to 1.71.

The issue is consistently reproducible on CentOS 7 but also sometimes occurs on modern distributions such as Debian 12 or Ubuntu 22.04. Also I noted that the problem always appears when downloading different crates.

$ cargo fetch
    Updating crates.io index
    Updating `private` index
  Downloaded autocfg v1.1.0
  Downloaded unicode-ident v1.0.8
  Downloaded bitflags v1.3.2
  Downloaded openssl-macros v0.1.1
  Downloaded uname v0.1.1
  Downloaded want v0.3.0
  Downloaded hyper-tls v0.5.0
  Downloaded time-macros v0.2.10
  Downloaded wasm-streams v0.2.3
  Downloaded tracing-futures v0.2.5
  Downloaded tracing-attributes v0.1.24
  Downloaded crossbeam-channel v0.5.8
  Downloaded pin-project v1.1.0
...
  Downloaded getrandom v0.2.9
  Downloaded proc-macro2 v1.0.64
  Downloaded windows v0.48.0
  Downloaded windows v0.36.1
warning: spurious network error (50 tries remaining): [28] Timeout was reached (download of `scopeguard v1.1.0` failed to transfer more than 10 bytes in 30s)
warning: spurious network error (50 tries remaining): [28] Timeout was reached (failed to download any data for `countme v3.0.1` within 30s)
  Downloaded countme v3.0.1
  Downloaded scopeguard v1.1.0
warning: spurious network error (50 tries remaining): [28] Timeout was reached (download of `unsafe-libyaml v0.2.8` failed to transfer more than 10 bytes in 30s)
warning: spurious network error (50 tries remaining): [28] Timeout was reached (failed to download any data for `serde_yaml v0.9.21` within 30s)
  Downloaded serde_yaml v0.9.21
  Downloaded unsafe-libyaml v0.2.8
warning: spurious network error (50 tries remaining): [28] Timeout was reached (download of `pin-utils v0.1.0` failed to transfer more than 10 bytes in 30s)
warning: spurious network error (50 tries remaining): [28] Timeout was reached (failed to download any data for `slab v0.4.8` within 30s)
  Downloaded slab v0.4.8
  Downloaded pin-utils v0.1.0  
^Cownloading 150 crates, remaining bytes: 120.2 KB  

Steps

  1. run cargo fetch

Possible Solution(s)

No response

Notes

To mitigate this issue, you can try disabling HTTP multiplexing by setting the environment variable "CARGO_HTTP_MULTIPLEXING" to "false":

export CARGO_HTTP_MULTIPLEXING=false

Version

cargo 1.71.0 (cfd3bbd8f 2023-06-08)
release: 1.71.0
commit-hash: cfd3bbd8fe4fd92074dfad04b7eb9a923646839f
commit-date: 2023-06-08
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.1 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:OpenSSL/1.1.1t)
ssl: OpenSSL 1.1.1t  7 Feb 2023
os: CentOS 7.0.0 [64-bit]
@babinskiy babinskiy added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Aug 18, 2023
@Veetaha
Copy link

Veetaha commented Aug 31, 2023

The workaround is currently unknown. Disabling the HTTP multiplexing seems to to solve this but it breaks due to another bug #12524

@weihanglo
Copy link
Member

This zulip topic was discussing a similar issue. The culprit might be bad curl. Could you install rust 1.72.0 and try again?

@weihanglo weihanglo added A-networking Area: networking issues, curl, etc. S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. and removed S-triage Status: This issue is waiting on initial triage. labels Sep 6, 2023
@babinskiy
Copy link
Author

Thanks a lot @weihanglo
Upgrading to 1.72.0 has fixed this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Area: networking issues, curl, etc. C-bug Category: bug S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants