rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.11k stars 879 forks source link

Can't update from 1.8 to 1.9 on Windows: could not rename component file #501

Closed jacobmorzinski closed 7 years ago

jacobmorzinski commented 8 years ago

I'm not sure if this is related to #426 or different... but the error message is different, so I'll open a new issue ticket and you can close if desired.

I can't update from 1.8 to 1.9, using the MSVC stable branch:

C:\Users\Jacob> rustup self update
info: checking for self-updates
info: downloading self-update
info: rustup updated successfully

C:\Users\Jacob>rustup --version
rustup 0.1.12 (c6e430a 2016-05-12)

C:\Users\Jacob>rustup show
stable-i686-pc-windows-msvc (default)
rustc 1.8.0 (db2939409 2016-04-11)

C:\Users\Jacob>rustup update
info: syncing channel updates for 'stable-i686-pc-windows-msvc'
info: downloading component 'rustc'
 35.0 MiB /  35.0 MiB (100 %)   5.2 MiB/s ETA:   0 s
info: downloading component 'rust-std'
 46.6 MiB /  46.6 MiB (100 %)   5.5 MiB/s ETA:   0 s
info: downloading component 'rust-docs'
  5.6 MiB /   5.6 MiB (100 %)   4.9 MiB/s ETA:   0 s
info: downloading component 'cargo'
info: rolling back changes
error: could not rename component file from 'C:\Users\Jacob\.multirust\toolchains\stable-i686-pc-windows-msvc\bin/test-4fda350b.dll.lib' to 'C:\Users\Jacob\.multirust\tmp\hvxiy3mkmyzhkgdr_file'
info: checking for self-updates
info: rustup is up to date

  stable-i686-pc-windows-msvc update failed - rustc 1.8.0 (db2939409 2016-04-11)

I do have a .multirust\tmp folder. I don't see anything in it that would block the creation of files in it. If I try to move test-4fda350b.dll.lib by hand, I can move it by hand.

jacobmorzinski commented 8 years ago

...but rustup update worked fine on a second computer of mine (again stable windows msvc). I wonder what's up with my first computer.

peschkaj commented 8 years ago

It also worked flawlessly on my own test system. On Thu, May 26, 2016 at 5:07 PM Jacob Morzinski notifications@github.com wrote:

...but rustup update worked fine on a second computer of mine (again stable windows msvc). I wonder what's up with my first computer.

— You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub https://github.com/rust-lang-nursery/rustup.rs/issues/501#issuecomment-222028510, or mute the thread https://github.com/notifications/unsubscribe/AAEXkouw_yXSJtVSLZpJMUDmrtKBL2yAks5qFjW5gaJpZM4In7hQ .

Jeremiah Peschka

jacobmorzinski commented 8 years ago

Trying it a few more times (and with RUST_BACKTRACE=1) gave a more clear indication that there is an OS access error:

error: could not rename component file from 'C:\Users\Jacob\.multirust\toolchains\stable-i686-pc-windows-msvc\bin/rustc_borrowck-4fda350b.dll.lib' to 'C:\Users\Jacob\.multirust\tmp\lffl4knje_vwe2m5_file'
info: caused by: Access is denied. (os error 5)
info: backtrace:

I didn't care enough to debug it, so I worked around the issue with rustup toolchain remove stable followed by rustup toolchain install stable.

All set here.

brson commented 8 years ago

Thanks for the report. I'm afraid I don't know what the issue is offhand.

mati865 commented 7 years ago

Just ran into this issue upgrading x86_64 msvc rust 1.14 to 1.15 but after 3 fails next try succeed.

jacobmorzinski commented 7 years ago

My original report is solved: it turns out that my anti-virus (Sophos) was blocking one of the file replacement actions that rustup was trying to perform. Sorry for not catching this earlier.

BatmanAoD commented 7 years ago

I am also seeing this issue trying to upgrade from 1.16 to 1.17 (the first time I've attempted and update).

I'm on a company-provided Windows 7 laptop running McAfee antivirus (which AFAIK I can't disable, even temporarily), so I wouldn't be at all surprised if McAfee is somehow preventing file-access.

I tried eight times, and each time the file that could not be renamed was different. (The failure always came when attempting to install the rust-src component.)

tjkierzkowski commented 7 years ago

I'm having the same issue with McAfee, specifically Endpoint Security as well. I too cannot whitelist rustup or remove the program as I don't have admin rights entirely on my VM at work. They may not have updated some of the virus definitions or maybe their fuzzer is over-eager but some of the files are being blocked. This only seems to be affecting the stable channel but not the nightly one. I've deleted everything and reinstalled rust via rustup at least 2 times and this still seems to be happening. Here's a snippet from powershell in my VM:

image

The stable channel hasn't been able to update for at least since I installed it February. Let me know what I else I can do to help out!

emabee commented 6 years ago

McAfee explicitly reports rustup and/or rustc and/or cargo and deletes them every now and then. Reinstall is possible, but mcafee kicks in about every second day! This should be fixed in McAfee generally! Are there any negotiations already?

mati865 commented 6 years ago

The best thing you can do is contacting your AV producent, even if they know about it already more reports can increase priority of this bug.

23.12.2017 00:16 "emabee" notifications@github.com napisał(a):

McAfee explicitly reports rustup and/or rustc and/or cargo and deletes them every now and then. Reinstall is possible, but mcafee kicks in about every second day! This should be fixed in McAfee generally! Are there any negotiations already?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rust-lang-nursery/rustup.rs/issues/501#issuecomment-353689054, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHsdhrebiSADZrpFrlVZB696ohU00Iuks5tDDg9gaJpZM4In7hQ .