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

ParentContainsErrorRecordException, The process cannot access the file 'C:\Program Files\dotnet\dotnet.exe' because it is being used by another process. #387

Closed
2 of 5 tasks
IhateTrains opened this issue Feb 24, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@IhateTrains
Copy link

Description:
setup-dotnet action fails with ParentContainsErrorRecordException: https://github.com/ParadoxGameConverters/ImperatorToCK3/actions/runs/4262267753/jobs/7417899979

Task version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Use setup-dotnet to set up up NET 6 and do something with it. In the next steps, use setup-dotnet again to set up .NET 7.
Example:
https://github.com/ParadoxGameConverters/ImperatorToCK3/actions/runs/4262267753/jobs/7417899979

Expected behavior:
The action should set up .NET 7.

Actual behavior:
I'm getting the following exception:

dotnet-install: Failed to extract package. Exception: Exception calling "ExtractToFile" with "3" argument(s): "The process cannot access the file 'C:\Program Files\dotnet\dotnet.exe' because it is being used by another process."
ParentContainsErrorRecordException: D:\a\_actions\actions\setup-dotnet\v3\externals\install-dotnet.ps1:816
Line |
 816 |  …             [System.IO.Compression.ZipFileExtensions]::ExtractToFile( …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "ExtractToFile" with "3" argument(s): "The process cannot access the file 'C:\Program
     | Files\dotnet\dotnet.exe' because it is being used by another process."
@IhateTrains IhateTrains added bug Something isn't working needs triage labels Feb 24, 2023
@panticmilos
Copy link
Contributor

hi @IhateTrains, thank you for the report, we will take a look at it :)

@bhargavgaglani07
Copy link

We are facing same issue with Self-hosted runner. Kindly note that it works with v2, and also was working with v3 few days back.

dotnet-install: Extracting the archive.
dotnet-install: Failed to extract package. Exception: Exception calling "ExtractToFile" with "3" argument(s): "The process cannot access the file 'C:\Program Files\dotnet\dotnet.exe' because it is being used by another process."
Exception calling "ExtractToFile" with "3" argument(s): "The process cannot access the file 'C:\Program 
Files\dotnet\dotnet.exe' because it is being used by another process."
....
+ ...             [System.IO.Compression.ZipFileExtensions]::ExtractToFile( ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : IOException

@nikolai-laevskii
Copy link
Contributor

The fix is already on its way and will be included in closest release.

If you don't have time to wait you may temporarily adjust your workflow to install several versions of dotnet at once instead of calling action several times: https://github.com/actions/setup-dotnet#usage.

Thank you for reporting the issue and providing a very comprehensive and detailed description!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants