Skip to content

Access is denied. (os error 5) on re-installation of rustup using bleeding edge build #4068

Description

@ssg47

Verification

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

  1. I downloaded the 'bleeding edge build' as mentioned in this comment on error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to [...] #4050, unpacking it to: C:\Users\my-user-id\Downloads\rustup-init-x86_64-pc-windows-msvc_bleeding_edge.
  2. On my Windows laptop, I opened a PowerShell 5.1 tab in Windows Terminal Preview.
  3. I set the proxy setting using $env:HTTPS_PROXY = 'blah.proxy-name.net:obscure-port'
  4. 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.
  5. I opened a new tab and closed the orignal to pick up the new PATH setting.
  6. 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.
  7. I opened a new tab and closed the previous tab to pick up the cleared PATH setting.
  8. I set the proxy setting using $env:HTTPS_PROXY = 'blah.proxy-name.net:obscure-port'
  9. 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 (3db381b 2024-10-14)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: No rustc is 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)

Activity

  1. rami3l commented on Nov 6, 2024

    @rami3l
    Member

    @djc @ChrisDenton I'm not quite sure what happened here, but could this be related to #4023 (since a fresh reinstallation works alright but not an upgrade)?

  2. ChrisDenton commented on Nov 6, 2024

    @ChrisDenton
    Member

    I would doubt it's related to #4023. The error here is renaming a temp directory (rust-docs\share/doc/rust/html) that contains web files whereas #4023 only affects proxies (aka .exe files).

  3. ChrisDenton commented on Nov 6, 2024

    @ChrisDenton
    Member

    I don't know for sure this is the issue but I have seen this sort of thing before with anti-malware applications being overzealous. Most such issues are reported on a newly released rustup (before anti-malware applications have had time to update their allow lists) so pre-release rustup may be worse in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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