Access is denied. (os error 5) on re-installation of rustup using bleeding edge build
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
Verification
- I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
- I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
Problem
To resolve #4050, I was offered the 'bleeding edge build'. I was just using it for a re-installation and got this error:
info: rolling back changes
error: could not rename component file from 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html': Access is denied. (os error 5)
after a series of messages (see below for full output) like this:
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
Steps
- I downloaded the 'bleeding edge build' as mentioned in this comment on #4050, unpacking it to:
C:\Users\my-user-id\Downloads\rustup-init-x86_64-pc-windows-msvc_bleeding_edge. - On my Windows laptop, I opened a PowerShell 5.1 tab in Windows Terminal Preview.
- I set the proxy setting using
$env:HTTPS_PROXY = 'blah.proxy-name.net:obscure-port' - I Installed Rust usingC:\Users\my-user-id\Downloads\rustup-init-x86_64-pc-windows-msvc_bleeding_edge, selecting option 1 "Proceed with standard installation (default - just press enter)" - I didn't save the output but some rety errors were shown.
- I opened a new tab and closed the orignal to pick up the new PATH setting.
- To isolate the particular change that allowed the installation to go ahead, I uninstalled it using
rustup self uninstall. I did not notice any errors. - I opened a new tab and closed the previous tab to pick up the cleared PATH setting.
- I set the proxy setting using
$env:HTTPS_PROXY = 'blah.proxy-name.net:obscure-port' - I then reinstalled it using
C:\Users\my-user-id\Downloads\rustup-init-x86_64-pc-windows-msvc_bleeding_edge. Full output below
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
C:\Users\my-user-id\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
C:\Users\my-user-id\.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
C:\Users\my-user-id\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2024-10-17, rust version 1.82.0 (f6e511eec 2024-10-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.3 MiB / 16.3 MiB (100 %) 8.0 MiB/s in 2s
info: downloading component 'rust-std'
19.5 MiB / 19.5 MiB (100 %) 7.9 MiB/s in 2s
info: downloading component 'rustc'
62.0 MiB / 62.0 MiB (100 %) 8.1 MiB/s in 7s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.3 MiB / 16.3 MiB (100 %) 1.4 MiB/s in 20s
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: rolling back changes
error: could not rename component file from 'C:\Users\my-user-id\.rustup\tmp\jkok1xr5cypspwh6_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html': Access is denied. (os error 5)
Press the Enter key to continue.
g
C:\Users\my-user-id\Documents\WindowsPowerShell
>
Possible Solution(s)
In order to reinstall after the above, I deleted the entire .rustup folder from C:\Users\my-user-id and was then able to re-run the installer successfully.
The output from the successful re-installation is here:
> C:\Users\my-user-id\Downloads\rustup-init-x86_64-pc-windows-msvc_bleeding_edge\rustup-init.exe
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
C:\Users\my-user-id\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
C:\Users\my-user-id\.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
C:\Users\my-user-id\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2024-10-17, rust version 1.82.0 (f6e511eec 2024-10-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.3 MiB / 16.3 MiB (100 %) 8.1 MiB/s in 2s
info: downloading component 'rust-std'
19.5 MiB / 19.5 MiB (100 %) 8.1 MiB/s in 2s
info: downloading component 'rustc'
62.0 MiB / 62.0 MiB (100 %) 8.1 MiB/s in 7s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.3 MiB / 16.3 MiB (100 %) 1.5 MiB/s in 20s
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: retrying renaming 'C:\Users\my-user-id\.rustup\tmp\m4ytg1cgoluqyxga_dir\rust-docs\share/doc/rust/html' to 'C:\Users\my-user-id\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: installing component 'rust-std'
19.5 MiB / 19.5 MiB (100 %) 17.7 MiB/s in 2m 6s
info: installing component 'rustc'
62.0 MiB / 62.0 MiB (100 %) 16.7 MiB/s in 3s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-pc-windows-msvc'
stable-x86_64-pc-windows-msvc installed - rustc 1.82.0 (f6e511eec 2024-10-15)
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload its PATH environment variable to include
Cargo's bin directory (%USERPROFILE%\.cargo\bin).
Press the Enter key to continue.
Notes
There were quite a few retry messages during the original installation (which succeeded) but they seemed to complete successfully so I ignored them.
My user account is a member of the local Administrators group but I was not running PowerShell as Administrator.
Rustup version
rustup --version
rustup 1.27.1+467 (3db381b0b 2024-10-14)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: Norustcis currently active
Installed toolchains
rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\my-user-id.rustup
installed toolchains
active toolchain
no active toolchain
OS version
Windows 10 Pro 22H2 (OS Build 19045.5011)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Windows re-installation with the bleeding-edge rustup-init.exe and the reported .rustup paths. Investigate the failed rename of the rust-docs directory and verify that reinstallation succeeds without requiring deletion of the entire .rustup folder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100