-
Notifications
You must be signed in to change notification settings - Fork 994
Description
Problem
rustup self update fails with an access denied error on Windows 10 with Cisco AMP for Endpoints installed.
Output:
C:\Users\gordon.tyler> rustup self update
info: checking for self-updates
info: downloading self-update
info: rustup updated successfully to 1.18.3
error: could not copy file from 'C:\Users\gordon.tyler\.cargo\bin\rustup-init.exe' to 'C:\Users\gordon.tyler\.cargo\bin\rustup.exe'
info: caused by: Access is denied. (os error 5)
Possible Solution(s)
Cisco AMP does some funky stuff with file deletions, especially executables. I've personally experienced the following sequence of events:
- Delete a file in Windows Explorer
- See the file disappear from the window
- Hit F5 to refresh and the file re-appears
- Hit F5 to refresh again a few seconds later and the file disappears again.
My theory is that Cisco AMP interferes in the file deletion code path, returns a success code to the caller but doesn't actually delete the file until it has finished scanning it.
It's possible that if rustup self update is attempting to delete the old rustup.exe and immediately copy in a replacement, then Cisco AMP is interfering. Retrying a few times over a few seconds may workaround this.
Notes
Output of rustup --version:
rustup 1.18.3 (435397f48 2019-05-22)
(this is the version I was updating to)
Output of rustup show:
Default host: x86_64-pc-windows-msvc
stable-x86_64-pc-windows-msvc (default)
rustc 1.33.0 (2aa4c46cf 2019-02-28)