InstallationDirectoryPath parameter shared among machines

Last week we did a first deployment of our applications to production by using Octopus Deploy after having tested it extensively in our testing environments. Unfortunately we ran into an issue and we’re not quite sure if this is an issue with Octopus Deploy or an unsupported scenario.

We currently have four web servers in our production environment which usually all run the same version of our software. To test out the deployment with Octopus Deploy in our production environment we removed one of the web servers from our load balancer and disabled the deployment targets in Octopus Deploy on the other 3 machines. This allowed us to deploy to that one machine specifically and make sure that everything was ready before we did a full deployment across all machines.

However, when we deployed to all the machines we ran into a problem. Our deployment process is set up to deploy the NuGet packages to the machine, and then have two child steps for creating the IIS application pool and the IIS application itself. For that last step we use #{Octopus.Action[].Output.Package.InstallationDirectoryPath} variable to get to the path where the IIS application should be mapped to. Since one of the machines already had the same version of the package we were deploying, its installation path was different from the other machines. However, Octopus Deploy used the path from that machine across the other machines as well, causing an IIS application to be created mapping to a non-existing path.

Obviously this wasn’t what we expected to happen. One might argue that this isn’t a supported scenario, however we wonder what happens when we decide to scale up our production environment with another machine. On that machine the paths will be different as well, potentially resulting in the same issue.

Hi,

Thanks for reaching out. Output variables such as the one you are using need to know the machine name to give the correct answer. Due to as you know, machines can have different values, you need to know the machine name in subsequent steps to get the correct value to use. We do try to fill the value in with a value for uses where only one machine is used in a deployment to aid in things like email steps, but it is never guaranteed to give the correct result if you have more than one machine.

A variable with the machine name looks like this

#{Octopus.Action[].Output[MachineName].Package.InstallationDirectoryPath}

Now, we do understand why you (and other users that reported the same) were expecting that behavior. We discussed this with our dev team, and though we are not 100% sure if we can get it to work like you were expecting (so you don’t have to specify the machine name on the variable), we will investigate if we can make it behave this way.

Here is the issue that you can track for progress: https://github.com/OctopusDeploy/Issues/issues/2322

Regards,
Dalmiro