-
Notifications
You must be signed in to change notification settings - Fork 2.6k
unable to connect to index.crates.io #13457
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
Comments
Got the same issue but when I build an image with docker. Any help welcome! PS: cargo 1.76.0 (c84b367 2024-01-18) |
seems to be an similar issue to this one #7096 i guess |
Not at all! Something is wrong with index.crates.io and their DNS ... |
For me it turns out that this is caused by curl and not by cargo. Don't know how, but sure. |
Got the same issue on my machine.
When visiting this website using the browser it works.
But other websites work with curl
The main site crates.io also doesn't work
|
For me on Linux $> curl https://crates.io But: is NOT working... |
@MrMic The last command works and does exactly what it is supposed to do, namely return $ curl -I https://index.crates.io/
HTTP/2 404 You have to access a specific path to test curl -I https://index.crates.io/config.json
HTTP/2 200 The issues you mention with Docker are unrelated to this issue, since your error is |
For the folks with the SSL error, can you run curl -Iv https://index.crates.io/config.json |
@jdno You are right about the curl issue; indeed, my DNS issue is still open |
I located this to the issue being the curl connection, however this only happens on crates.io. It works for every other website. |
Can you run |
Sure, here is the output. I'll preface it with saying that using -H"Pragma: no-cache" doesn't really help. The operation succeeds like 1 in 10 or 20.
The output from a success:
<
|
I can confirm @R-Goc 's output (#13457 (comment)) Running on Ubuntu 22.04, curl 7.81, openssl 3.x Oddly, if I use the Success
Failure:
Failure for me is happening on a simple |
I'm using Windows. For me curl 8.4 on Win seems to work if I specify -4. Specifying -6 makes it fail.
Looking at it with wireshark, the handshake completes, but then the server immediately sends a RST Frame. The Client doesn't get the opportunity to send the tls client hello. WSL curl 7.68.0 -4 works. v6 isn't configured for v6 so cargo defaults to ipv4 so it works. For me the workaround seems to be to disable ipv6 in my network adapter, at least when I need cargo to run. Is there an option to force cargo to v4? At least for @R-Goc the failure is v6 and the success v4 as well. I don't think the other errors are of the same cause as they show a different error. @kdopen is able to send a Client Hello as far as I can tell. |
I believe this may have to do with Windows packet filtering. I have a Windows device and a Linux device in the same physical network, and I only observe the described problems from the Windows device. I looked at the Windows Event Viewer under In WireShark however, they appear as About 5 - 10% of requests go through without being dropped. Based on the pcap, I cannot see any difference between the connection that goes through and the one that is imediately being I suspect the issue to be related to IPv4/v6 differences. E.g. postman, which always uses IPv4, always succeeds for |
If someone is still going through this issue on Windows, please try by adding |
I tried that before I found the workaround for me with ipv4 only. Getting the index worked. Downloading the crates didn't work for me. |
How would you set cargo to use ipv4? |
a (clearly suboptimal) workaround is to make cargo use git for the protocol, and git-cli for its git work .. the CLI can be whatever you have installed and it usually uses ipv4 instead of ipv6 .. so ..
in cargo.toml should be enough for that .. now if whatever git-cli you have is still doing git via ipv6, you could configure it with something like :
there's also the more intrusive way of just going into windows network adapter advanced setting, finding the ipv4 and ipv6 specific advanced properties and configuring the metric manually to give ipv4 lower (i.e higher preference) metric compared to ipv6 instead of the typically selected 'Automatic metric' checkbox for both of them .. in theory that should make windows prefer the lower-metric option and for those who might only occasionally run into the issue, you could prob simply get by increasing the number or retries cargo makes before it gives up .. by setting up CARGO_NET_RETRY=10 etc in the env (instead of the default 3) (and for those who know what they're doing and find that it is indeed a ssl cert revocation issue for them, you could add CARGO_HTTP_CHECK_REVOKE=false to your env too) |
I can confirm that this is a bug with Windows - cargo is doing nothing wrong. Turning Windows Defender Firewall off has fixed the issue for me (however this may not be advisable). The firewall has been breaking other apps for me as well (mainly the Helldivers 2 updater), so I'm not too upset about turning this feature off. If anyone has the guts to brave Microsoft's bug reporting process, just know that you have my support. |
I now tried again and everything seems to be working perfectly. I don't know what fixed it sadly. I didn't change any network settings. My windows version is newer now, but I also updated cargo. Current version: I don't know if I should close this issue or not. |
Since the issue author has their original problem solved. I am going to close this. If anyone still has networking issue with the latest Cargo, feel free to open a new issue. Thank you all! |
Problem
When attempting to download crates, I get a warning: spurious network error (3 tries remaining): [35] SSL connect error (Recv failure: Connection was reset). After the next tries it causes the install to fail with:
Caused by: [35] SSL connect error (Recv failure: Connection was reset)
This started happening on my new windows 11 machine.
Steps
Clean installation on a new windows 11 system, all updates installed. Attempting to install any crate fails.
Possible Solution(s)
No response
Notes
The toolchain used makes no difference. Already tried setting these options in the global config.toml, based on some previous issues:
[source.crates-io]
index = "https://github.com/rust-lang/crates.io-index" # I set the source to the official github index
[http]
proxy = "" # leaving this as a blank string resets proxy to default
http.check-revoke = false
#check-revoke = false
None of which worked. I am not using Windows defender. I am using Eset antivirus as I was on my previous computer, where I didn't have this problem.
Version
The text was updated successfully, but these errors were encountered: