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

warning: spurious network error #13291

Closed
slyfox1186 opened this issue Jan 13, 2024 · 5 comments
Closed

warning: spurious network error #13291

slyfox1186 opened this issue Jan 13, 2024 · 5 comments
Labels
C-bug Category: bug S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@slyfox1186
Copy link

slyfox1186 commented Jan 13, 2024

Problem

So running the below command to build a static version of Rav1e I get a spam error code.
cargo cinstall --prefix=/home/jman/tmp/ffmpeg-build-script/workspace --library-type=staticlib --crt-static --release

The error is

warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)

Steps

  1. curl -sSf --proto '=https' --tlsv1.2 'https://sh.rustup.rs' | sh -s -- -y &>/dev/null
  2. cargo install --version '0.9.29+cargo-0.76.0' cargo-c
  3. curl -Lso rav1e-0.7.1.tar.gz 'https://github.com/xiph/rav1e/archive/refs/tags/v0.7.1.tar.gz'
  4. unpack the tar.gz
  5. cd into dir
  6. cargo cinstall --prefix=/home/jman/tmp/ffmpeg-build-script/workspace --library-type=staticlib --crt-static --release
  7. the error message spams over and over

Possible Solution(s)

I had to run
cargo build --release
then I ran
cargo cinstall --prefix=/home/jman/tmp/ffmpeg-build-script/workspace --library-type=staticlib --crt-static --release
and it installed.

Notes

No response

Version

cargo 1.75.0 (1d8b05cdd 2023-11-20)
release: 1.75.0
commit-hash: 1d8b05cdd1287c64467306cf3ca2c8ac60c11eb0
commit-date: 2023-11-20
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]
@slyfox1186 slyfox1186 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jan 13, 2024
@weihanglo
Copy link
Member

Could you check if you can resolve the hostname index.crates.io with other CLI tools? Such as

  • curl https://index.crates.io
  • dig index.crates.io
  • nslookup index.crates.io

You might also want to check any of the config under [http] to make sure the connection is configured currently for your local environment

@weihanglo weihanglo added 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 Jan 14, 2024
@dbpaul
Copy link

dbpaul commented Jan 22, 2024

same or similar problem here cargo 1.46.0

  • create an ubuntu16.04 server in the cloud
  • apt update && apt install cargo
  • cargo install boringtun-cli (or whatever, nothing works)
    Updating crates.io index
    warning: spurious network error (2 tries remaining): bad packet length; class=Net (12)
    warning: spurious network error (1 tries remaining): bad packet length; class=Net (12)
    error: failed to fetch https://github.com/rust-lang/crates.io-index

Caused by:
error reading from the zlib stream; class=Zlib (5)

-no matter from which cloud provider, download always stops at around 12.x%

@thangchung
Copy link

I have got the same problem. I use devcontainer on Ubuntu 22 box.

Updating crates.io index
warning: spurious network error (3 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: index.crates.io)
error: failed to query replaced source registry `crates-io`

Caused by:
  download of config.json failed

Caused by:
  failed to download from `https://index.crates.io/config.json`

Caused by:
  [6] Couldn't resolve host name (Could not resolve host: index.crates.io)

@weihanglo
Copy link
Member

For devcontainer, see #6513 (comment) for possible fixes.

For cargo 1.46.0, that is not a supported version of Cargo. Please use the latest version and we can debug it.

I am going to close this as the original author hasn't yet responded for a while. Please check #6513, which has different symptoms and solutions. Thank you.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
@kuba-04
Copy link

kuba-04 commented Oct 3, 2024

when I had this problem, I initially thought that something got corrupted in my rust global setup, so I removed rust and tried to install again, because nothing else helped. Then to my astonishment I saw I can't even download rust from the official website. That was something wrong with my network, not sure what suddenly happened, but using mobile hotspot resolved the issue 🤷‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

5 participants