mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.75k stars 542 forks source link

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

Open SkyfallWasTaken opened 2 years ago

SkyfallWasTaken commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Hello, thanks for the reply!

emabrey commented 2 years ago

Can you provide the rust toolchain you are using?

rustup toolchain list is the command

SkyfallWasTaken commented 2 years ago

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 commented 11 months ago

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