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

Install octopus CLI action fails on a self-hosted windows runner #248

Closed
DavidThompsonWG opened this issue Feb 23, 2022 · 2 comments
Closed

Comments

@DavidThompsonWG
Copy link

Hi, I'm using the latest Octopus step (1.1.9) and I'm getting the error:

Cannot convert argument "entryNameEncoding", with value: "True", for "ExtractToDirectory" to type "System.Text.Encoding": "Cannot convert value "True" to type "System.Text.Encoding". Error: "Invalid cast from 'System.Boolean' to 'System.Text.Encoding'.""

Error: Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1

To Reproduce

Use the following:

  - name: Install Octopus CLI
    uses: OctopusDeploy/install-octopus-cli-action@v1.1.9
    with:
      version: latest

We are using a self-hosted runner, sadly on Window server 2012 R2

Screenshots

image

@johnsimons
Copy link
Contributor

Hi @DavidThompsonWG,

To fix this you need to either install Powershell Core or install a dotnet core (v5/v6) on the machine.
This unfortunately happens because of the code in https://github.com/actions/toolkit/blob/daf8bb00606d37ee2431d9b1596b88513dcf9c59/packages/tool-cache/src/tool-cache.ts#L374-L379 which is part of the Github lib.

As you can see from that code, you probably only have .NetFramework installed and hence calling [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) which won't work, have a look at the api specs ( https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectory?view=netframework-4.8#overloads ), on the other hand the .NetCore has the correct overloads ( https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectory?view=net-6.0#overloads ).

To me this is a flaw with the Github tool-cache Api and I have submitted a bug report in their repo, that you can subscribe to.

Given we won't be able to fix this, and hopefully the workarounds mentioned above work, I'll close this issue for now.
Let us know how you go?

Regards
John

@DavidThompsonWG
Copy link
Author

DavidThompsonWG commented Feb 24, 2022

Hi @johnsimons

Thanks for getting back to me. We do have the dotnet framework SDK 3.1, 5 and 6 installed on the server, but I will try and install Powershell Core, and see how we get on.

image

Thanks,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants