简体   繁体   中英

Cargo fails with “spurious network error: The operation timed out” on Windows 10 when using a local user

I'm trying to setup a Rust programming environment for a local user on a Windows 10 laptop that is usually connected to my company domain. Installing the stable version of Rust with rustup via rustup-init.exe completed without problems, but every time I try to use cargo to install tools or libraries I get an error message like the following:

warning: spurious network error (5 tries remaining): [2/-1] failed to send request: The operation timed out

This happens both from my company network and from my home one. I managed to setup Rust for my domain account without problems.

I suppose this is network related or it might involve the Sophos software my company uses as firewall/anti-virus; what is puzzling me is the fact that just about every other network related utility I tried works without problems, from git to curl .

I'd like to use this additional user because there are utilities my company blocks for domain users but not for local ones, such as Dropbox.

For me, I used a proxy once and it was set as a variable in CMD.
To show your proxy settings, in an administrator cmd type:

netsh winhttp show proxy

if you have one you can reset it by:

netsh winhttp reset proxy

I don't have a definite explanation, but cargo works correctly when the VPN towards my office is active. I guess it really is something to do with security software.

I spent a good hour trying to figure this out and came across 2 potential solutions

  1. There could be an issue with ssh: dependency, fixed it by starting ssh agent:
eval `ssh-agent -s`
ssh-add
cargo build
  1. setup in a global ~/.gitconfig
[url "ssh://git@github.com/"]
    insteadOf = https://github.com/

Removing this in ~/.gitconfig also solved the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM