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

Access Denied OS Error 5 on Windows 7 #69

Closed
Henning-K opened this issue May 9, 2017 · 7 comments
Closed

Access Denied OS Error 5 on Windows 7 #69

Henning-K opened this issue May 9, 2017 · 7 comments
Labels

Comments

@Henning-K
Copy link

Freshly installed Win7 a few days ago, I have since installed a bunch of stuff for Rust (rustup, rust, some cargo subcommands). However when I tried out cargo watch after installing it, I got
failed to add to job object: Access denied (OS Error 5)
for some reason...

cargo watch --debug:

>>> Load Git/VCS ignores: true
>>> Default ignores: ["*\\.DS_Store", "*.swp", "*\\.hg\\*", "*\\.git\\*", "*\\.svn\\*", "*\\target\\*"]
>>> All ignores: ["*\\.DS_Store", "*.swp", "*\\.hg\\*", "*\\.git\\*", "*\\.svn\\*", "*\\target\\*"]
>>> Commands: ["cargo check"]
>>> Watches: ["."]
>>> Watchexec arguments: Args { cmd: "cd F:\\Development\\crate-name && echo [Running \'cargo check\'] && cargo check && echo [Finished running]", paths: ["."], filters: [], ignores: ["*\\.DS_Store", "*.swp", "*\\.hg\\*", "*\\.git\\*", "*\\.svn\\*", "*\\target\\*"], clear_screen: false, signal: None, restart: true, debug: true, run_initially: true, no_shell: false, no_vcs_ignore: false, once: false, poll: false, poll_interval: 1000 }
*** glob converted to regex: Glob { glob: "**/target/**", re: "(?-u)^(?:/?|.*/)target(?:/?|/.*)$", opts: GlobOptions { case_insensitive: false, literal_separator: true }, tokens: Tokens([RecursivePrefix, Literal('t'), Literal('a'), Literal('r'), Literal('g'), Literal('e'), Literal('t'), RecursiveSuffix]) }
*** built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes
*** Loaded "\\\\?\\F:\\Development\\crate-name\\.gitignore"
*** Adding ignore: "*\.DS_Store"
*** Adding ignore: "*.swp"
*** Adding ignore: "*\.hg\*"
*** Adding ignore: "*\.git\*"
*** Adding ignore: "*\.svn\*"
*** Adding ignore: "*\target\*"
*** glob converted to regex: Glob { glob: "*\\.hg\\*", re: "(?-u)^.*/\\.hg/.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('h'), Literal('g'), Literal('/'), ZeroOrMore]) }
*** glob converted to regex: Glob { glob: "*\\.git\\*", re: "(?-u)^.*/\\.git/.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('g'), Literal('i'), Literal('t'), Literal('/'), ZeroOrMore]) }
*** glob converted to regex: Glob { glob: "*\\.svn\\*", re: "(?-u)^.*/\\.svn/.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('s'), Literal('v'), Literal('n'), Literal('/'), ZeroOrMore]) }
*** glob converted to regex: Glob { glob: "*\\target\\*", re: "(?-u)^.*/target/.*$", opts: GlobOptions { case_insensitive: false, literal_separator: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('t'), Literal('a'), Literal('r'), Literal('g'), Literal('e'), Literal('t'), Literal('/'), ZeroOrMore]) }
*** built glob set; 0 literals, 0 basenames, 1 extensions, 0 prefixes, 1 suffixes, 0 required extensions, 4 regexes
*** Watching "\\\\?\\F:\\Development\\crate-name"
*** Assembled command "cmd.exe" "/C" "cd F:\\Development\\crate-name && echo [Running \'cargo check\'] && cargo check && echo [Finished running]"
thread 'main' panicked at 'failed to add to job object: Zugriff verweigert (os error 5)', C:\User
s\name\.cargo\registry\src\github.com-1ecc6299db9ec823\watchexec-1.8.3\src\process.rs:192
note: Run with `RUST_BACKTRACE=1` for a backtrace.
[Running 'cargo check']

Platform:
Windows 7 SP 1

rustc -vV:

rustc 1.19.0-nightly (f1140a331 2017-05-08)
binary: rustc
commit-hash: f1140a33176a5fb2e91e26ea3ae42a834dd9bfdf
commit-date: 2017-05-08
host: x86_64-pc-windows-msvc
release: 1.19.0-nightly
LLVM version: 4.0

cargo -vV:

cargo 0.19.0-nightly (fa7584c14 2017-04-26)
release: 0.19.0
commit-hash: fa7584c1495c2d9c04a6416f8e7b546abfa88a52
commit-date: 2017-04-26
@Henning-K
Copy link
Author

Update:
Some talk with WindowsBunny in the #rust-beginners IRC channel revealed that this problem comes Windows 7 not allowing nested jobs which is the case when you invoke this binary with cargo watch as cargo apparently dispatches the call to the subcommand through a job.

Though the program worked flawlessly for me before on Windows (apparently that was an earlier version).

@passcod
Copy link
Member

passcod commented May 9, 2017

Right, we now go through watchexec, so that's what does that. The "dispatches the call to the subcommand through a job" thing is so killing process groups works, which is what #25 was about. You may want to file a bug on watchexec for this.

@Henning-K
Copy link
Author

Before this crate used watchexec it worked perfectly fine for me for months, so I'll file a bug when I have the time, most likely on wednesday(today by now) or thursday.

@passcod
Copy link
Member

passcod commented May 9, 2017

Yeah, there's definitely tradeoffs. If you don't need the bugfixes / new features we got by using watchexec, you can downgrade to 4.0.3 which is the last non-watchexec version:

cargo install --force --vers 4.0.3

@Henning-K
Copy link
Author

So should this issue remain closed or be reopened as the (underlying) problem is not resolved?

@mattgreen
Copy link

Using cargo watch 4.0.3 is probably the best thing here. There's not much I can do that won't break process watching.

@passcod
Copy link
Member

passcod commented May 10, 2017

Yeah, I'm going to call it as "not supporting Windows 7 or lower" for cargo watch >= 5. I'll add a mention to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants