actions / actions/setup-dotnet
A cancelled run may leave you with a broken .NET installation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 572
- Avg merge
- 12d 20h
- Merged PRs (30d)
- 1
Description
Description:
Cancelling a workflow, manually or due to concurrency groups rules, while it's trying to setup a .NET installation may leave the runner in a broken state.
Task version:
v4
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Repro steps:
Cancel a workflow while it's running the setup-dotnet action, possibly specifically while it's extracting an archive.
setup-dotnet log
Run actions/setup-dotnet@v4
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command & 'D:\actions-runner\_work\_actions\actions\setup-dotnet\v4\externals\install-dotnet.ps1' -SkipNonVersionedFiles -Runtime dotnet -Channel LTS
dotnet-install: .NET Core Runtime with version '8.0.1' is already installed.
dotnet-install: Adding to current process PATH: "C:\Program Files\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command & 'D:\actions-runner\_work\_actions\actions\setup-dotnet\v4\externals\install-dotnet.ps1' -SkipNonVersionedFiles -Channel 6.0
dotnet-install: Downloaded file https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.418/dotnet-sdk-6.0.418-win-x64.zip size is 262714741 bytes.
dotnet-install: Either downloaded or local package size can not be measured. One of them may be corrupted.
dotnet-install: Extracting the archive.
Error: The operation was canceled.
Specifically, this left me with a half-extracted directory at C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.26. Deleting the 6.0.26 directory, then re-running the workflow was successful.
Expected behavior:
Either finish the archive extraction, or rollback unfinished changes.
Actual behavior:
Workflow stops immediately, leaving runner in broken state.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the actions/setup-dotnet@v4 entry point and its externals/install-dotnet.ps1 script on a Windows self-hosted runner. Reproduce cancellation during archive extraction, then inspect how the interrupted extraction leaves C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.26. Done means cancellation either completes extraction or rolls back unfinished changes so a rerun succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, typescript
- Domain
- ci-cd, devops, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100