Deploy Fails on Windows Server 2019 with Trend Worry-Free Business Security

Using Octopus version 3.17.14.

Deploying to Windows Server 2019 with Trend Worry-Free Business security fails with the following errors:

| Failed: TargetHost 15:43:31 Fatal | Drop Existing 'AppUser' Users (Custom) on TargetHost | | Failed: Drop Existing 'AppUser' Users (Custom) 15:43:09 Verbose | Octopus Server version: 3.17.14+Branch.master.Sha.582e2b1203ecda0df06e121f68db11ee20ee583d 15:43:09 Verbose | Environment Information: | OperatingSystem: Microsoft Windows NT 6.3.9600.0 | OsBitVersion: x64 | Is64BitProcess: True | CurrentUser: MYDOMAIN\OctopusAdmin | MachineName: OctopusServer | ProcessorCount: 2 | CurrentDirectory: C:\Windows\system32 | TempDirectory: C:\Users\OctopusAdmin\AppData\Local\Temp\ | HostProcessName: Octopus.Server | PID: 5488 15:43:09 Info | Executing script on 'TargetHost' 15:43:30 Error | Windows PowerShell terminated with the following error: 15:43:30 Error | 15:43:30 Error | The type initializer for 'System.Management.Automation.Runspaces.InitialSessionState' threw an exception. 15:43:30 Error | 15:43:30 Error | 15:43:30 Verbose | Updating manifest with output variables 15:43:30 Verbose | Updating manifest with action evaluated variables 15:43:31 Fatal | The remote script failed with exit code -65536 15:43:31 Verbose | at Octopus.Worker.Scripting.ScriptResult.EnsureSuccessful() | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.<>c__DisplayClass29_0.<ExecuteActionAndInitLoggingContext>b__0() | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, Machine machine) | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, Machine machine, PlannedAction action)

| == Failed: Step 2: Disable SomeStep == 12:59:01 Fatal | The step failed: Activity Disable SomeStep on TargetHost failed with error 'The remote script failed with exit code 1'. 12:59:01 Verbose | Disable SomeStep completed | | Failed: TargetHost 12:58:58 Verbose | Octopus Server version: 3.17.14+Branch.master.Sha.582e2b1203ecda0df06e121f68db11ee20ee583d 12:58:58 Verbose | Environment Information: | OperatingSystem: Microsoft Windows NT 6.3.9600.0 | OsBitVersion: x64 | Is64BitProcess: True | CurrentUser: MYDOMAIN\OctopusAdmin | MachineName: OctopusServer | ProcessorCount: 2 | CurrentDirectory: C:\Windows\system32 | TempDirectory: C:\Users\octopusad\AppData\Local\Temp\ | HostProcessName: Octopus.Server | PID: 5488 12:58:58 Info | Executing script on 'TargetHost' 12:58:59 Verbose | Octopus Deploy: Calamari version 3.7.116 12:58:59 Verbose | Environment Information: 12:58:59 Verbose | OperatingSystem: Microsoft Windows NT 10.0.17763.0 12:58:59 Verbose | OsBitVersion: x64 12:58:59 Verbose | Is64BitProcess: True 12:58:59 Verbose | CurrentUser: NT AUTHORITY\SYSTEM 12:58:59 Verbose | MachineName: TargetHost 12:58:59 Verbose | ProcessorCount: 2 12:58:59 Verbose | CurrentDirectory: C:\Octopus\Work\20190416045859-77728-80 12:58:59 Verbose | TempDirectory: C:\Windows\TEMP\ 12:58:59 Verbose | HostProcessName: Calamari 12:59:00 Verbose | Executing 'C:\Octopus\Work\20190416045859-77728-80\Script.ps1' 12:59:01 Error | Calamari.exe : Windows PowerShell terminated with the following 12:59:01 Error | error: 12:59:01 Error | At C:\Octopus\Work\20190416045859-77728-80\Bootstrap.ps1:23 char:1 12:59:01 Error | + & "${env:TentacleHome}\Calamari\3.7.116\Calamari.exe" run-script -scr ... 12:59:01 Error | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12:59:01 Error | + CategoryInfo : NotSpecified: (Windows ...error: :String) [], RemoteException 12:59:01 Error | + FullyQualifiedErrorId : NativeCommandError 12:59:01 Verbose | Updating manifest with output variables 12:59:01 Verbose | Updating manifest with action evaluated variables 12:59:01 Fatal | The remote script failed with exit code 1 12:59:01 Verbose | at Octopus.Worker.Scripting.ScriptResult.EnsureSuccessful() | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.<>c__DisplayClass29_0.<ExecuteActionAndInitLoggingContext>b__0() | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, Machine machine) | at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, Machine machine, PlannedAction action) 12:59:01 Fatal | Disable SomeStep on TargetHost

If Trend is disabled, the deployment completes without issue.

The issue does not exist on Windows Server 2012 with the same version of Trend and the same Trend policies applied which leads me to believe the issue is specific to Windows Server 2019 + PowerShell + Trend.

Hi @bright

Thanks for getting in touch!

It seems you are not the first to experience problems with Powershell and AV on newer Windows Server OS machines, this issue reports the same problem.

That very much indicates that this is an issue that will need to be investigated with Trend and doesn’t appear to be related to Octopus. If it helps Calamari (which is what is running when the issue presents) is open source so you can inspect the code as needed.

Sorry I can’t be of more help at this point,

Regards,
Alex

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