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

"An existing connection was forcibly closed by the remote host." error on Windows (with Rust + MSVC) #1186

Open
SkyfallWasTaken opened this issue Jun 16, 2022 · 5 comments

Comments

@SkyfallWasTaken
Copy link

When I try to build my Rust project, I get this error:

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `C:\Users\Mahad\.cargo\bin\sccache.exe rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 2)
  --- stderr
  sccache: error: failed to execute compile
  sccache: caused by: Failed to send data to or receive data from server
  sccache: caused by: An existing connection was forcibly closed by the remote host. (os error 10054)

Restarting the server/machine/VS Code did not help. In addition to this, Kaspersky's Web Anti-Virus is turned off.

@emabrey
Copy link
Contributor

emabrey commented Aug 18, 2022

OS error 10054 indicates the peer application reset the TCP connection (set the TCP RST flag). That could be from improper firewall configuration, spotty wifi, etc.

As it is right now I don't have enough information to determine if this is a bug in sccache, or if you simply had a transient networking issue.

Can you provide more information about your network environment and what you were trying to compile? Also, if you could provide your windows version that would also be helpful.

@SkyfallWasTaken
Copy link
Author

Hello, thanks for the reply!

  • My network is pretty stable (~40Mbps)
  • I was trying to compile a Tauri project I think? (can't remember)
  • I was using local disk storage
  • I'm using Windows version 10.0.19044.1889

@emabrey
Copy link
Contributor

emabrey commented Aug 27, 2022

Can you provide the rust toolchain you are using?

rustup toolchain list is the command

@SkyfallWasTaken
Copy link
Author

I can't remember (I switched away from Windows to Linux) but I'm pretty sure it was the latest stable Rust version at the time.

@wmmc88
Copy link

wmmc88 commented Oct 31, 2023

I also run into this issue occasionally on windows with only a local disk cache.

sccache: error: failed to execute compile
sccache: caused by: Failed to send data to or receive data from server
sccache: caused by: An existing connection was forcibly closed by the remote host. (os error 10054)

Sometimes I use sccache stop-server and sccache start-server to try to restart the server, but most of the time, the issue is not resolved and I have to resort to resetting RUSTC_WRAPPER

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

3 participants