Offline install script loses output variables

I have an Octopus deployment that deploys to two machines with different roles. In one of the steps, a package is deployed to both machines (i.e. to machines with both roles). The next step, also executed on both machines, sets an output variable.

When both targets have normal octopus tentacles installed, no problem. However, I experimented with offline package drop for ONE of the two targets, and found that the installation failed because a path to a package was incorrect. It turned out that the script was attempting to access the package installation directory for the other target, and that the output variable scoped to the offline machine had somehow been lost between steps. Mujltiple values were available (for both targets), as expected, in one step, and then gone after the next (OctopusPrintEvaluatedVariables = true)…

I’ve extracted (and anonomised) the output variables corresponding to the problem step from the deployment output, and shown how the values for the current deployment target are lost, below:

Step 7:

[Octopus.Action[Deploy CI additional resources].Output.Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output.Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output.Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’

Step 8:

[Octopus.Action[Deploy CI additional resources].Id] = ‘cae7c6b5-e1ec-41a7-8ee1-b96aff131720’
[Octopus.Action[Deploy CI additional resources].Name] = ‘Deploy CI additional resources’
[Octopus.Action[Deploy CI additional resources].Number] = ‘6’
[Octopus.Action[Deploy CI additional resources].Output.Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output.Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’

Note the final folder number was different on the two machines - hence the deployment failed as it was looking for the folder from MACHINE2 when it should have been looking for the folder from MACHINE1

Seems like a bug to me…

Hi Steve,

Thanks for getting in touch! Initially I suspect the issue you’re facing may possibly be due to the version of Octopus you’re using. We added support for output variables in offline drops in 2018.3.0; which version are you currently running?

If you’re post-2018.3.0, this indeed seems strange. Could you send us through the full verbose deployment log with debugging variables enabled as outlined in the following doc page? That will hopefully shed some more light on what could be causing this issue.

I look forward to hearing back and getting to the bottom of this one!

Best regards,

Kenny

Hi Kenny.

We are on v2019.3.4, so no issues with the version. Its the offline drop and as you can see from my post I already have OctopusPrintEvaluatedVariables set to true, and am redirecting output to a log file.

Happy to send it in with a copy of the process for the deployment concerned… can you give me an address to mail it to so that it isn’t in a public forum?

Cheers

Steve

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