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

Expand-Archive : is not a supported archive file format. .zip is the only supported archive file format. - Windows Runner #241

Closed
2 of 5 tasks
redanthrax opened this issue Jun 28, 2022 · 3 comments · Fixed by #250
Assignees
Labels
bug Something isn't working

Comments

@redanthrax
Copy link

Description:
Setup Windows 10 Runner without go installed already.
After setting up I have a step on my workflow: actions/setup-go@v3
Placed the full error at the bottom.

Action version:
actions/setup-go@v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
go 1.18

Repro steps:
Setup a self hosted runner on a fresh Windows 10 install.
Specify a step in a go project to use acitons/setup-go@v3 on the self hosted windows runner.
You should get the error specified below.

Expected behavior:
During the extract process go should be extracted.

Actual behavior:
Receive the following error.
Expand-Archive : is not a supported archive file format. .zip is the only supported archive file format.

Run actions/setup-go@v3
Setup go version spec 1.18
Attempting to download 1.18...
matching 1.18...
Acquiring 1.18.3 from https://github.com/actions/go-versions/releases/download/1.18.3-2426432064/go-1.18.3-win32-x64.zip
Extracting Go...
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 'C:\Users\User\actions-runner\_work\_temp\69939204-4b8f-4ec8-b18f-b0dc2509d44c' -DestinationPath 'C:\Users\User\actions-runner\_work\_temp\43363100-5525-4011-867d-ef3863a56e8a' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\Users\User\actions-runner\_work\_temp\69939204-4b8f-4ec8-b18f-b0dc2509d44c', 'C:\Users\User\actions-runner\_work\_temp\43363100-5525-4011-867d-ef3863a56e8a', $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 'C:\Users\User\actions-runner ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive
The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
Falling back to download directly from Go
Install from dist
Acquiring go1.18.3 from https://storage.googleapis.com/golang/go1.18.3.windows-amd64.zip
Extracting Go...
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 'C:\Users\User\actions-runner\_work\_temp\8352c1a6-99ab-4b64-9920-1[15](https://github.com/redanthrax/rmmagent/runs/7097201014?check_suite_focus=true#step:3:16)dfe35207b' -DestinationPath 'C:\Users\User\actions-runner\_work\_temp\7bd5e377-42b4-4930-8126-a6342480422f' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\Users\User\actions-runner\_work\_temp\8352c1a6-99ab-4b64-9920-115dfe35207b', 'C:\Users\User\actions-runner\_work\_temp\7bd5e377-42b4-4930-8126-a6342480422f', $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 'C:\Users\User\actions-runner ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive
Error: Failed to download version 1.[18](https://github.com/redanthrax/rmmagent/runs/7097201014?check_suite_focus=true#step:3:19): Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
@redanthrax redanthrax added bug Something isn't working needs triage labels Jun 28, 2022
@redanthrax redanthrax mentioned this issue Jun 28, 2022
2 tasks
@dmitry-shibanov
Copy link
Contributor

Hello @redanthrax. Thank you for your report. We'll investigate the issue.

@ImAbhishekTomar
Copy link

similar issue.


Run actions/setup-go@v3
  with:
    go-version: ^1.18
    cache: true
    check-latest: false
    token: ***
Setup go version spec ^1.18
Attempting to download ^1.18...
API rate limit exceeded for 198.[2](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:2)0[3](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:3).175.175. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Falling back to download directly from Go
Install from dist
Acquiring go1.19.[4](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:4) from https://storage.googleapis.com/golang/go1.19.4.windows-amd64.zip
Extracting Go...
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:\ghes\runner2\actions-runner\_work\_temp\3df4f31[5](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:5)-5[6](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:6)9d-4a82-84b6-6a113e8a8[7](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:8)c6' -DestinationPath 'D:\ghes\runner2\actions-runner\_work\_temp\7676f737-7476-4bde-b130-33229dbb60f1' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('D:\ghes\runner2\actions-runner\_work\_temp\3df4f315-569d-4a[8](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:9)2-84b6-6a113e8a87c6', 'D:\ghes\runner2\actions-runner\_work\_temp\7676f737-7476-4bde-b130-3322[9](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:10)dbb60f1', $true) }"
Expand-Archive :  is not a supported archive file format. .zip is the only supported archive file format.
At line:1 char:2[10](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:11)
+ ...  Ignore)) { Expand-Archive -LiteralPath 'D:\ghes\runner2\actions-runn ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive
Error: Failed to download version ^1.[18](https://github.optum.com/umrcps-canonicals/ebaas-mapper-umr-elgindividual-go/runs/1252958?check_suite_focus=true#step:3:19): Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1

@Vampire
Copy link

Vampire commented Dec 23, 2022

A work-around on the consumer side should be to update the available PowerShell version.
On the GitHub hosted runners 7.2.7 / 7.2.8 is available and there extracting archives that do not end in .zip works without a problem.
I guess the PowerShell available on that self-hosted runner is 5.1 or similar and there probably this restriction still exists.

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
5 participants