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

Cargo can't install crates with spurious network error (on Windows) #3750

Closed
sikinmettugi opened this issue Feb 22, 2017 · 9 comments
Closed

Comments

@sikinmettugi
Copy link

TL; DR

cargo install racer fails with "spurious network error" due to Microsoft Windows HTTP service's internal error.

Environment

  • Windows 7 x86_64 (Language: Korean)
  • A machine inside of a local network
  • No proxy(AFAIK)

When Does the Problem Occurs

  • When I re-install Rust(by rustup-init.exe, and rust-1.15.1-x86_64-pc-windows-{gnu, msvc}.msi) and try to install crates via cargo
  • (Those three install methods have the same error, i.e. uninstall via rustup self uninstall then install via one of those 3 methods above)
  • I couldn't check whether rustup-init.exe for gnu toolchain solves this(zlib.dll issues make rustup-init.exe for gnu toolchain fails)

Error message

$ cargo install racer -v
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): [2/-1] failed to send request: Microsoft Windows HTTP 서비스에서 내
부 오류가 발생했습니다.

warning: spurious network error (1 tries remaining): [2/-1] failed to send request: Microsoft Windows HTTP 서비스에서 내
부 오류가 발생했습니다.

error: failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  [2/-1] failed to send request: Microsoft Windows HTTP 서비스에서 내부 오류가 발생했습니다.

@note: I am using Windows in Korean language, that is the reason the error log has Korean(and could not find the error message localizer/translator site)

@note: The error message is translated as "An internal error occured in Microsoft Windows HTTP service."

More Informations

  • I got this same issue when I install Rust for the first time in January(rust compiler for Rust 1.14.0 stable) but somehow solved when I re-install Rust with .msi stand-alone installer, not with rustup-init.exe.
  • This time, the stand-alone installer has the same issue.
@alexcrichton
Copy link
Member

Hm interesting! Do you know if there's anything "special" about the network setup on your system? Something like a custom CA, a custom "company firewall", or something like that?

It looks like this is an HTTP request somewhere inside libgit2 failing, but we may just not be passing through enough configuration to get it to pass.

@sikinmettugi
Copy link
Author

The network admin went outdoor service for a while, so I will update more elaborate network setups after he is available. (It's 11am here btw :) )

  • My machine is in an internal network of a company network(The network of the "Division" which contains several teams, are separated.)
  • That internal network is not directly connected to outside internet network. Some gateway system is present, but not sure exactly what is. (will ask the admin)
  • There IS a custom company firewall.
  • My personal Macbook(which uses wifi, not LAN cable) does not have issues with cargo.
    • The wireless network is not directly connected to the Division network (AFAIK, but not sure exactly).

@alexcrichton
Copy link
Member

Ah ok, I suspect that this is likely related to the custom company firewall. I presume, though, that other system services work just fine? Are you sure though that a proxy doesn't need to be configured for outside network traffic to work?

@sikinmettugi
Copy link
Author

Can you elaborate what other system services do I have to check, @alexcrichton ?
And, I don't think I have the expressive words to ask admin about proxy or firewall. Should I ask like, "What configuration should I check if Windows HTTP service fails to check some data on Github?"

@alexcrichton
Copy link
Member

I'm really just shooting in the dark here, I have no idea what's going on :(

@sikinmettugi
Copy link
Author

sikinmettugi commented Mar 3, 2017

Turns out:

TL; DR

Stupid Korean antivirus(Ahnlab V3 Internet Security 9.0) matter.

How Did I solved(temporarily)

  • Turned off V3's firewall, replace it with Windows 7's native one: cargo can access crates.io-index and is able to do the job.

I am still not sure which part did this sh.. stuff prevent from "infection." Going to call service centre.
Thank you @alexcrichton, for your kind comments.

Okay, Is Everything Good Now?

  • Think I should Ahnlab what exactly did they blocked, and how to generate a allow-list for Rust, cargo and relevant tools. (For other Rustaceans in South Korean coorporations which use V3)
  • For this, one last request: can I get which binaries/network rules should I allow?
    • e.g. I found 5 cargo.exe-s on my machine: one on .cargo, one on each .multirust for both Windows Rust toolchains, and one on each .rustup for those toolchains.
    • And thank you, in advance.

@alexcrichton
Copy link
Member

Oh wow how odd! Thanks for tracking that down @sikinmettugi :)

The ~/.cargo/bin/cargo.exe shouldn't need network access, but the others should (they're just different verisons of Cargo installed through rustup most likely)

@aturon
Copy link
Member

aturon commented Mar 11, 2017

I'm going to go ahead and close this as resolved.

@aturon aturon closed this as completed Mar 11, 2017
@rishavs
Copy link

rishavs commented Aug 15, 2018

same issue here. On windows 10. INstalling rust for the first time.

PS C:\Users\Mockingbird\DevSpace\Actix\hello> cargo run
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): failed to send request: The operation timed out
; class=Os (2)
warning: spurious network error (1 tries remaining): failed to send request: The operation timed out
; class=Os (2)
error: failed to load source for a dependency on `actix-web`

Caused by:
  Unable to update registry `https://github.com/rust-lang/crates.io-index`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  failed to send request: The operation timed out
; class=Os (2)

Rust version is stable-x86_64-pc-windows-msvc unchanged - rustc 1.28.0 (9634041f0 2018-07-30). I do not have any proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants