Bootstrapper did not return the bootstrapper service message

Hi,

I’m getting a weird error when running a script on a tentacle. It’s a very simple PowerShell script to determine the tentacles OS Architecture (32/64) and it throws an exception very quickly. Googling says MS Office alot, but the stack trace says Octopus alot.

Any ideas?

| == Failed: Run step template: Determine Machine Architecture ==
07:41:59   Verbose  |   Cleaning up completed AdHocScript tasks. Deleting 0 finished tasks...
07:42:03   Fatal    |   Activity failed with error 'Bootstrapper did not return the bootstrapper service message'.
|   Bootstrapper did not return the bootstrapper service message
| 
|   == Failed: Run script on: D7L0M0D3 ==
07:42:02   Verbose  |     Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
07:42:02   Verbose  |     Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
07:42:02   Verbose  |     No user context provided. Running as current user.
07:42:02   Verbose  |     Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Work\20210513074202-468273-35' using 'Western European (DOS)' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
07:42:03   Verbose  |     Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20210513074202-468273-35 exited with code 0
07:42:03   Fatal    |     Bootstrapper did not return the bootstrapper service message
07:42:03   Verbose  |     at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.Immediate.ImmediateExecutor.GetBootstrapperScriptGeneratorThatWasUsed(List`1 serviceMessages) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionExecution/Immediate/ImmediateExecutor.cs:line 310
|     at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.Immediate.ImmediateExecutor.ExecuteCalamari(CalamariFlavour calamariFlavour, String calamariCommand, IReadOnlyList`1 calamariArguments, IReadOnlyList`1 files, IReadOnlyList`1 deploymentTools, VariableCollection extraVariables, TargetManifest targetManifest, CalamariPlatformConstraint calamariPlatformConstraint, Nullable`1 isolationMutexTimeout) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionExecution/Immediate/ImmediateExecutor.cs:line 163
|     at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionExecution.CommandBuilders.CalamariCommandBuilder.Execute() in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionExecution/CommandBuilders/CalamariCommandBuilder.cs:line 146
|     at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Script.ScriptActionHandler.ExecuteWithDefaultScriptHandler(IActionHandlerContext context) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/Steps/Script/ScriptActionHandler.cs:line 61
|     at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.AdHocActionDispatcher.InvokeActionHandler(Machine target, ActionHandlerInvocation actionHandler, ActionAndTargetScopedVariables actionAndTargetScopedVariables, IExecutor executor, TargetManifest targetManifest) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/AdHocActionDispatcher.cs:line 167
|     at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.AdHocActionDispatcher.Dispatch(Machine machine, ActionHandlerInvocation actionHandler, VariableCollection variables) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/AdHocActionDispatcher.cs:line 62
|     at Octopus.Server.Orchestration.ServerTasks.AdHocScript.AdHocScriptTaskController.RunScript(Machine target, VariableCollection variables) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/AdHocScript/AdHocScriptTaskController.cs:line 384
|     at Octopus.Server.Orchestration.ServerTasks.AdHocScript.AdHocScriptTaskController.<>c__DisplayClass20_1.<ExecuteOnDeploymentTargets>b__3(DeploymentTarget machine) in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/AdHocScript/AdHocScriptTaskController.cs:line 203
|     at Octopus.Server.Orchestration.ServerTasks.OctoThreadClosure`1.Execute() in /opt/buildagent/work/c42ca9d2b8233f1c/source/Octopus.Server/Orchestration/ServerTasks/OctoThreadClosure.cs:line 71
|

Hi @matthewericford

Thanks for getting in touch and sorry to hear that you’ve run into an issue with your script.

Are you able to successfully run the script on the machine outside of Octopus? If it works, could you share the script so I can do some further testing, please?

Regards,

Yeah it’s a really boring script:

$Is64Bit = $ENV:PROCESSOR_ARCHITECTURE -like "*64*"

if($Is64Bit){ 
    $PFFolder = ${env:ProgramFiles(x86)} 
}
else{ 
    $PFFolder = ${env:ProgramFiles}
}

Set-OctopusVariable -name "EnvProgramFiles" -value $PFFolder

Write-Host "variable EnvProgramFiles set to $PFFolder"
Write-Host "access example: #{Octopus.Action[Determine Machine Architecture].Output.EnvProgramFiles}"

Hi @matthewericford

Thanks for providing the script. Unfortunately, I haven’t been able to reproduce the error that you’re running into.

Just to confirm, if you run the following on the target directly - it works?

$Is64Bit = $ENV:PROCESSOR_ARCHITECTURE -like "*64*"

if($Is64Bit){ 
    $PFFolder = ${env:ProgramFiles(x86)} 
}
else{ 
    $PFFolder = ${env:ProgramFiles}
}

Write-Host variable is set to $PFFolder

I don’t have literal access to the machine unfortunately, but it errors every time when running via Octopus.

One of my users just saw I ran this script again and messaged me to say he’s seen it before and that it’s a random freebie AntiVirus blocking powershell scripts!

Google’d and mentioned on this link, so I think it’s safe to close this ticket down thanks :slight_smile:

Hi @matthewericford

Well done - and thank you for letting me know you found the cause of the problem!

Regards,

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