Octopus Manager prerequisites cannot find Powershell

We just upgraded our Octopus Server to v2020.5.0 on Windows Server 2019 Datacenter and are having problems launching Octopus Manager.

The prereq-check fails on Powershell with the following error:

powershell.exe -NonInteractive -NoProfile -Command “Write-Output $PSVersionTable.PSVersion”
System.Exception: Error when attempting to execute powershell.exe: Object reference not set to an instance of an object.
—> System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Shared.Util.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Action1 debug, Action1 info, Action1 error, NetworkCredential runAs, IDictionary2 customEnvironmentVariables, CancellationToken cancel)
— End of inner exception stack trace —
at Octopus.Shared.Util.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Action1 debug, Action1 info, Action1 error, NetworkCredential runAs, IDictionary2 customEnvironmentVariables, CancellationToken cancel)
at Octopus.Shared.Util.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Action1 info, Action1 error, NetworkCredential runAs, IDictionary`2 customEnvironmentVariables, CancellationToken cancel)
at Octopus.Manager.Server.PreReq.PowerShellPrerequisite.CheckPowerShellIsInstalled(String& commandLineOutput)

Runtime versions is as follows:
.NET Framework 4.8
.NET Core 3.1.10

Powershell is in version 5.1.17763.1492 and we also have Powershell 7.1.0 installed.

I’ve started the Octopus Server service manually and it seems to work fine but Octopus Manager refuses to launch.

Hi Johan,

Thank you for contacting Octopus Support.

Typically this error is due to a lack of necessary permissions. I recommend running Process Monitor while launching Octopus Manager as a starting point to see if anything stands out. We’ve also seen anti-virus software get in the way as well. If that ends up being the case whitelisting Octopus.Manager.Server.exe may help.

Let me know what you think.

Regards,
Donny

I am unsure what events to look for.

I do get some BUFFER OVERFLOW results from QueryInformationVolume and QueryAllInformationFile while checking for powershell. But the path is: “C:\Windows\Fonts\segoeui.ttf” and the Generic Read and CloseFile seems to work.

Hi Johan,

Thank you for getting back to me.

While logged in as the same user that Octopus Server is installed on, does this user have high enough permissions to execute the following command from the command prompt?

powershell.exe -NonInteractive -NoProfile -Command “Write-Output $PSVersionTable.PSVersion”

Most likely the user does not have “Run as administrator” permissions for cmd.exe (either that or antivirus is getting in the way). I would recommend testing the user associated with Octopus Server on your machine’s environment using the above command.

Let me know how you make out.

Regards,
Donny

That was the first thing I tried.

It works with no issues like a charm.

We’ve also noticed that deployment tasks running on the server fails, we had to reconfigure all our notification steps to run on target machines instead.

Additionally we updated to the latest patch-release but the same issue persist.

Hi Johan,

Thank you for getting back to me.

Running the command in a non-elevated command prompt as the same user Octopus Server should (hopefully) eliminate permissions as a potential issue. This would leave antivirus as the most likely culprit.

Could you try temporarily disabling the antivirus on this machine then try to open Octopus Manager?

Let me know what you find out.

Regards,
Donny

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