Skip to content

Self-hosted Windows Runner Fails to Install Python #904

@dnwillia-work

Description

@dnwillia-work

Description:
The action fails to install Python on a Windows 10 self-hosted runner. The following error is encountered:

 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'D:\ANSYSDev\actions-runner\_work\_temp\14631187-76a2-41c4-a7d1-8e9f15a8ab70' -DestinationPath 'D:\ANSYSDev\actions-runner\_work\_temp\e4873571-c293-4d72-ac71-50341e9e0d70' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('D:\ANSYSDev\actions-runner\_work\_temp\14631187-76a2-41c4-a7d1-8e9f15a8ab70', 'D:\ANSYSDev\actions-runner\_work\_temp\e4873571-c293-4d72-ac71-50341e9e0d70', $true) }"  
  Expand-Archive :  is not a supported archive file format. .zip is the only supported archive file format.
  At line:1 char:210
  + ...  Ignore)) { Expand-Archive -LiteralPath 'D:\ANSYSDev\actions-runner\_ ...
  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
      + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive

This is working on the GitHub windows-latest-8-core runner. It seems setup-python is not the only one impacted. eg:

actions/setup-go#241

I have both Powershell 5.1 and 7.4.3 installed but as you can see the action seems to be picking the former.

Action version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
3.10

Repro steps:
I simply added the following into my CI workflow file and it fails.

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'

Expected behavior:
Python is downloaded and unzipped, the action works as expected.

Actual behavior:
It's not downloaded and installed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions