Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo new <packagename> on Windows 10 will not cargo run: "error: Access is denied. (os error 5)" #10671

Closed
timotheos-firestone opened this issue May 15, 2022 · 3 comments
Labels
C-bug Category: bug O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@timotheos-firestone
Copy link

timotheos-firestone commented May 15, 2022

Problem

Generating a new project with Cargo makes a project that is not runnable on Microsoft Windows 10 Pro.

Steps

  1. Following the Getting Started instructions on the website, install Rust by downloading and running rustup-init.exe (64-bit installer).
  2. Open the Windows Terminal (press the Windows button, type "command prompt" and hit Enter).
  3. Verify the installation worked with cargo --version (it reports cargo 1.60.0 (d1fd9fe2c 2022-03-01)).
  4. Enter the commands listed in the instructions: cargo new <packagename>, cd <packagename>, and then cargo run.

Note that it outputs:

error: Access is denied. (os error 5)

cargo error

Possible Solution(s)

As a new user of Rust and Cargo, the error message is opaque and there is not much direction as what can be done next to fix this.

Version

cargo 1.60.0 (d1fd9fe2c 2022-03-01)
release: 1.60.0
commit-hash: d1fd9fe2c40a1a56af9132b5c92ab963ac7ae422
commit-date: 2022-03-01
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel)
os: Windows 10.0.17763 (Windows 10 Pro) [64-bit]
@timotheos-firestone timotheos-firestone added the C-bug Category: bug label May 15, 2022
@weihanglo
Copy link
Member

Thanks for the report! The error message always gets rooms to improve.

Could you run cargo run --verbose to see if we could narrow it down? Perhaps setting an environment variable set CARGO_LOG=debug to print the logs would be better if you can.

@timotheos-firestone
Copy link
Author

Thank you for your comment :)
Strangely, I cannot reproduce this issue anymore (cargo run now succeeds after the same instructions of step 2-4). Perhaps I have since restarted the computer and that fixed something. Perhaps it is something that occurs on first install but disappears after a restart? There is no issue with space on my hard drive or anything like that.

@weihanglo weihanglo added O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. labels May 18, 2022
@weihanglo
Copy link
Member

Got it. Thank you!
I am going to close this issue to reduce our already-exploding issue lists 😆. If you find any possible cause or a way to reproduce it, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

2 participants