rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Problem when trying to update rust using rustup

Open Detector-I opened this issue 3 years ago • 4 comments

Problem

when trying to update the rust using rustup update if somehow some problem accrue, like:

  1. having low available space in drive (temp folder or rustup/cargo folder)
  2. not having right permission for reading and writing in some needed folder

rustup will enter to a infinite loop with same message (different based on on which step it failed on) image I waited for some time and seems like it never exit from the loop... it keep trying and trying but nothing change... so the only way is using CTRL+C for force close it... but at this point the rust is unusable, and If I try to update again it give me some error message (also different based on on which step it failed on) image image I tried so many things to fix this, but nothing worked, at the end the only solution was uninstalling rust using rustup self uninstall and reinstalling it again...

Steps

  1. Having low space available in drive c (or any drive that rustup using for temp dir or cargo/rustup folders) or change permission of some files that rustup will try to change in update process
  2. Try to update using rustup update command
  3. when enter to infinite loop of error message, exit from it using CTRL+C

Possible Solution(s)

  • Check for needed size before starting update or any other operation that will write to disk.
  • Check to make sure all folders that rustup will read and write to have right write/right permission

Notes

No response

Rustup version

rustup 1.24.3 (ce5817a94 2021-05-31)

Installed toolchains

stable-x86_64-pc-windows-msvc

Detector-I avatar May 22 '22 11:05 Detector-I

It looks like something got in the way of rustup on your system; perhaps a virus scanner which is poorly behaved or poorly configured for example. If you interrupt rustup halfway through an install/update; then the easiest way to resolve this is to rustup toolchain uninstall $toolchain and then rustup toolchain install $toolchain again. We currently can't "repair" such a broken installation.

kinnison avatar May 25 '22 07:05 kinnison

Please let me know if that solves things for you.

kinnison avatar May 25 '22 07:05 kinnison

It looks like something got in the way of rustup on your system; perhaps a virus scanner which is poorly behaved or poorly configured for example. If you interrupt rustup halfway through an install/update; then the easiest way to resolve this is to rustup toolchain uninstall $toolchain and then rustup toolchain install $toolchain again. We currently can't "repair" such a broken installation.

The thing I think worth adding is checking for available space before starting install/update... I mean currently even if we don't have enough space in where rust (toolchains...) installed and try to update or install, it will start without checking anything... This lead to corruption.

Detector-I avatar May 25 '22 09:05 Detector-I

Unfortunately it's hard to know how much space will be needed to perform any particular component change; because of filesystem overheads etc. We could begin to do something about guessing if we had unpacked-size fields in the channel manifests I suppose. I'll need to look and see if we already have a suggestion around that

kinnison avatar May 25 '22 20:05 kinnison