Unknown script-extension: ps1 - OKTA 2020.4.10

Hello,

We have an issue with our deploys failing with the subject error 'Unknown script-extension: ps1 '.

The process steps to deploy have remained unchanged, but since the past deploy and the one that fails we have updated to v2020.4.10, previous version installed was from 2018-2019.

The step that fails is supposed to run a powershell script included in a .nupkg that is obtained from a repo.

The script itself is very simple and contains two “.\filename.ps1” references before its own code. These files are also included in the nupkg.

I have verified that Octopus is able to obtain the nupkg file and extract it to the \work folder on the Octopus server.

I have obtained and verified the file contents of the nupkg that is used by octopus from the cache folder.

I could not see any indications that antivirus is blocking the file.

ProcessMonitor doesnt really show anything of interest.

  • octopus creates the bootstrap.ps1 file

  • powershell gets launched
    |Command line:|“C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe” -NonInteractive -NoProfile -NoLogo -ExecutionPolicy Unrestricted -Command “$ErrorActionPreference = ‘Stop’; . {. ‘E:\Octopus\Work\20201202114032-73707-167\Bootstrap.ps1’ -variablePassword ffffffffffff==; if ((test-path variable:global:lastexitcode)) { exit $LastExitCode }}”
    |Current directory:|E:\Octopus\Work\20201202114032-73707-167|

  • powershell does not seem to have any issues using the bootstrap.ps1

  • powershell launches calamari which extracts the nupkg files contents

  • calamari finishes

  • powershell closes

  • octopus.server deletes the file in the work folder

Guided Failure mode does not help, as it seems that when this failure is triggered, Octopus has already deleted all the files in the work folder.

Any ideas?

Next step is trying to do remote powershell debugging to see if that gives any insight into where in bootstrap things go wrong.

Adding Powershell Debugmode variable didn’t seem to work either, as it seems the above error occurs before Powershell waits for a debugger to attach.

Question: Based om process monitor It seems that the bootstrapper.ps1 is the one that obtains the other script files to execute, and launches them from an already running powershell process?

I attempted to follow the documentation that linked to Github to see how the powershell module implementation was done in Octopus but couldn’t find the correct source repo for this.

Hi Alex,

Thank you for contacting Octopus Support. I’m sorry you are running into this issue.

Is the E:\ drive a network drive or a local disk on the target machine? If it is a network drive, you will likely need to have E:\Octopus\Work whitelisted in the antivirus for both the target machine and the machine hosting the E:\ drive. We have seen numerous instances where antivirus “gets in the way” without any indication of the antivirus blocking something.

Next, if you wouldn’t mind, could you send over a raw task log with variable logging turned on?

I look forward to hearing back from you and helping you get this resolved.

Regards,
Donny

Hi,

It is a local disk on the server.

I have asked for calamari and octopus.server executables to be whitelisted in case Microsoft Defender is the culprit.

I’ll send the log.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.