Skip to content

self update fails on windows (access is denied) #1869

@doxxx

Description

@doxxx

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:

  1. Delete a file in Windows Explorer
  2. See the file disappear from the window
  3. Hit F5 to refresh and the file re-appears
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions