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

Windows - Action fails to extract terraform zip #186

Closed
cpc-camarj opened this issue Apr 27, 2022 · 3 comments · Fixed by #187
Closed

Windows - Action fails to extract terraform zip #186

cpc-camarj opened this issue Apr 27, 2022 · 3 comments · Fixed by #187

Comments

@cpc-camarj
Copy link
Contributor

It appears that GitHub action attempts to extract the directory which stores the zip file rather than the zip file itself.

##[debug]Getting build for Terraform version 1.1.9: windows amd64
##[debug]Downloading Terraform CLI from https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_windows_amd64.zip
##[debug]Downloading https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_windows_amd64.zip
##[debug]Destination C:\runner\_work\_temp\6f8260ff-0480-4753-a60e-631c39fe0016
##[debug]download complete
##[debug]Extracting Terraform CLI zip file
##[debug]Using powershell at path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
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:\runner\_work\_temp\6f8260ff-0480-4753-a60e-631c39fe0016' -DestinationPath 'C:\runner\_work\_temp\42e7c998-6842-4bac-b5d3-517594df6e7c' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\runner\_work\_temp\6f8260ff-0480-4753-a60e-631c39fe0016', 'C:\runner\_work\_temp\42e7c998-6842-4bac-b5d3-517594df6e7c', $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:\runner\ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive
 
Error: Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
@cpc-camarj
Copy link
Contributor Author

Did some more digging, and this appears to be coming from the @actions/tool-cache dependency.

@cpc-camarj
Copy link
Contributor Author

C:\runner\_work\_temp\6f8260ff-0480-4753-a60e-631c39fe0016 is the actual file and not a directory, as I was assuming. Unless something has changed, I remember that Windows is pretty particular about file endings, so the Expand-Archive command may be failing due to the file not ending in .zip.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant