-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo tries to resolve an incorrect host name to download crates #7515
Comments
Thanks for the report! Can you try setting [http]
# This setting can be used to help debug what's going on with HTTP requests made
# by Cargo. When set to `true` then Cargo's normal debug logging will be filled
# in with HTTP information, which you can extract with
# `CARGO_LOG=cargo::ops::registry=debug` (and `trace` may print more).
#
# Be wary when posting these logs elsewhere though, it may be the case that a
# header has an authentication token in it you don't want leaked! Be sure to
# briefly review logs before posting them.
debug = false |
(Attempted to obtain a smaller trace but the problem suddenly is gone...) |
Thanks for the hint! So here's the problem.
The request is incorrectly redirected. Likely a mistake in our setup. Closing. |
Hello, I have encountered the same problem as you. May I know your solution? |
+1 |
It's caused by too many connections. Add following command before any of your cargo command:
For example:
Or, just add this env setting in your .bash_profile:
|
thank you , |
I am seeing a similar issue intermittently in CI when building a crate using maturin: It's similar to the original report, though the hostname appears to be
Is this truly caused by too many connections, as mentioned above? If so, some sort of throttling would be preferable to failing the build. Adding the |
Attempt to fix, might work. Source: rust-lang/cargo#7515
I encountered a similar issue in github CI with a different hostname:
Trying to build resulted in these error twice before suddenly working the third time. |
crates.io was having an outage see https://status.crates.io/incidents/qtcxln295f0n and https://blog.rust-lang.org/inside-rust/2023/07/21/crates-io-postmortem.html |
My solution is:
It worked for me. |
Problem
Cargo sometimes tries to resolve an incorrect host name to download crates. This problem is intermittent.
... while
curl
can indeed download data.Steps
cargo build
and it automatically downloads crates from that siteerror: failed to download from
https://crates-io.proxy.ustclug.org/api/v1/crates/xml-rs/0.7.0/download Caused by: [6] Couldn't resolve host name (Could not resolve host: crates)`Possible Solution(s)
I'm not familiar with cargo, so I don't know why this happens. This might be a problem with our reverse proxy set-up, but I'd like a pointer on how to figure out the root cause. :-)
Notes
Output of
cargo version
: cargo 1.37.0 (9edd089 2019-08-02)Another report
The text was updated successfully, but these errors were encountered: