Open matklad opened 3 years ago
Naturally, the log has 6 seconds wide hole in it:
[2021-02-27T08:55:00Z DEBUG cargo::ops::registry] http-debug: * Trying 140.82.121.6:443...
...SNIP...
[2021-02-27T08:55:01Z DEBUG cargo::ops::registry] http-debug: * Connection #0 to host github.com left intact
[2021-02-27T08:55:01Z DEBUG cargo::ops::registry] Version {
version: "7.74.0-DEV",
host: "unknown",
feature_ipv6: true,
feature_ssl: true,
feature_libz: true,
feature_ntlm: false,
feature_gss_negotiate: false,
feature_debug: false,
feature_spnego: false,
feature_largefile: false,
feature_idn: false,
feature_sspi: false,
feature_async_dns: true,
feature_conv: false,
feature_tlsauth_srp: false,
feature_ntlm_wb: false,
feature_unix_domain_socket: true,
ssl_version: "OpenSSL/1.1.1h",
libz_version: "1.2.11",
iconv_version_num: "0",
brotli_version_num: "0",
nghttp2_version_num: "1214a",
nghttp2_version: "1.33.90",
protocols: [
"file",
"http",
"https",
"mqtt",
],
}
[2021-02-27T08:55:06Z DEBUG cargo::ops::registry] http-debug: * Trying 52.85.243.102:443...
...SNIP...
[2021-02-27T08:55:08Z DEBUG cargo::ops::registry] http-debug: * Connection #1 to host static.crates.io left intact
I think I've debugged this! The problem was misconfigured DNS. I figured this out when I tried upgrading my system in parallel with stuck cargo, and saw the following output from my systems package manager:
direnv allow
direnv: loading ~/projects/wasmer/.envrc
direnv: using nix
direnv: ([/nix/store/wmgfjn5z4dj3z46548gl1zpnk06b42w3-direnv-2.27.0/bin/direnv export fish]) is taking a while to execute. Use CTRL-C to give up.
warning: unable to download 'https://cache.nixos.org/i776f62w3vlkyybs0fy64645zg6509is.narinfo': Couldn't resolve host name (6); retrying in 341 ms
warning: unable to download 'https://cache.nixos.org/mpkz2cwrf4bh957c3bbx010g5243w91g.narinfo': Couldn't resolve host name (6); retrying in 250 ms
warning: unable to download 'https://cache.nixos.org/i776f62w3vlkyybs0fy64645zg6509is.narinfo': Couldn't resolve host name (6); retrying in 623 ms
warning: unable to download 'https://cache.nixos.org/mpkz2cwrf4bh957c3bbx010g5243w91g.narinfo': Couldn't resolve host name (6); retrying in 640 ms
error: interrupted by the user
It would be nice if Cargo printed an error message along these lines as well.
thanks for filing this. I may have experienced a similar problem with a corporate ssh config pointing to an internal crates registry and was wondering if they overlap enough to share a solution.
Specifically, I have 2 questions:
Recently, I've been observing Cargo being stuck on the "Downloading n crates" message for quite a while. In theory, this shouldn't be happening, as I have a very good internet connection here. I am not sure what caused this, there are two variables: I moved to a new place with a faster Internet, and bought a new PC.
The backtrace is not really illuminating:
Naturally, when I killed cargo and re-run with
cargo got unstuck relatively promptly. Though, I think I might have caught the slowness nontheless?
See the log here: https://gist.github.com/matklad/ca62d3a9f9a34ba6d7cfede0efedf38a
Note
If I try to reproduce it (which, naturally, I can't anymore), I get much shorter timing:
This reminds me of this beauty: https://github.com/rust-lang/cargo/issues/3564#issuecomment-273939998