Skip to content

Can't use rd on \_work\_temp\... on Windows 10 Pro #852

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

Open
jonathanreznik1 opened this issue Jul 13, 2022 · 6 comments
Open

Can't use rd on \_work\_temp\... on Windows 10 Pro #852

jonathanreznik1 opened this issue Jul 13, 2022 · 6 comments

Comments

@jonathanreznik1
Copy link

I'm having this problem with running on a self hosted Windows 10 x64 machine. I am not sure why the rd command fails maybe was something to do with either current wd or else some other related process that is launched during the runner. I'm attaching the config file for the workflow as well and the build log.

main.yml.txt
Win10GithubRunnerfailure.txt

##[debug]Removed matchers: 'checkout-git'
node:child_process:397

      ex = new Error('Command failed: ' + cmd + '\n' + stderr);
           ^
Error: Command failed: rd /s /q "C:\actions-runner\_work\_temp\1b19991b-e599-4929-8de9-b9fedb87a66c"
The process cannot access the file because it is being used by another process.
    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  killed: false,
  code: 32,
  signal: null,
  cmd: 'rd /s /q "C:\\actions-runner\\_work\\_temp\\1b19991b-e599-4929-8de9-b9fedb87a66c"',
  stdout: '',
  stderr: 'The process cannot access the file because it is being used by another process.\r\n'
}
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run actions/checkout@v3
@jonathanreznik1 jonathanreznik1 changed the title Can't use actions/checkout@v3 on Windows 10 Pro Can't use rd on \_work\_temp\... on Windows 10 Pro Jul 13, 2022
@laurencee
Copy link

I have run into the exact same issue on Win10 Pro x64 when testing out a self-hosted runner setup with actions/checkout@v3

 Error: Command failed: rd /s /q "E:\actions-runner\_work\_temp\01fa925a-faec-495d-8d96-4d0de1babefd"
The process cannot access the file because it is being used by another process.


    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) ***
  killed: false,
  code: 32,
  signal: null,
  cmd: 'rd /s /q "E:\\actions-runner\\_work\\_temp\\01fa925a-faec-495d-8d96-4d0de1babefd"',
  stdout: '',
  stderr: 'The process cannot access the file because it is being used by another process.\r\n'

@laurencee
Copy link

For anyone else who finds this in the future, use actions/checkout@v2 instead and it'll work. It still has that same error in the logs but it doesn't stop the action completing and it seems to be successful.

@PavanMudigondaTR
Copy link

anyone have solution for v3 ? v2 seems way slow for 5GB repo !

mircearoata added a commit to satisfactorymodding/UnrealProjectUpdater that referenced this issue Nov 16, 2022
@noymer
Copy link

noymer commented Nov 21, 2022

Actually, the same problem happened on actions/checkout@v2, but not error but just warning occured without stopping steps or jobs as below.
(this is with checkout@v2 https://github.com/actions/checkout/tree/7884fcad6b5d53d10323aee724dc68d8b9096a2e )

"E:\Program Files\Git\cmd\git.exe" log -1 --format='%H'
...
...
(node:7256) UnhandledPromiseRejectionWarning: Error: Command failed: rd /s /q "E:\gh-runner\_work\_temp\bc931090-ce6d-4781-8bc4-277a535e6a0e"
...
The process cannot access the file because it is being used by another process.
    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
(node:7256) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7256) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

checkout@v2, which uses node12, make the Error: Command failed: rd /s /q to warning.
checkout@v3, which uses node16, make this problem error
because from node15, the default behaviour changed as the message Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is also written in the Node.js document

v15.0.0 | Changed default mode to throw. Previously, a warning was emitted.

https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode

@trickypr
Copy link

I have attempted to debug this, and I am pretty sure that the error occurs here. My suspicion is that there is some lingering git process that is still using this folder when checkout attempts to delete it, but I do not know how I would go about testing / fixing it.

trickypr added a commit to pulse-browser/browser that referenced this issue Dec 10, 2022
@davidlawson
Copy link

davidlawson commented Feb 2, 2023

Fixed on v3 for me by ensuring core.fsmonitor=false in C:\Program Files\Git\etc\gitconfig

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

No branches or pull requests

6 participants