Rolling Deployment When Running on Octopus Server not working


we have an azure powershell step template that runs on the octopus server on behalf of an APP role … the role may contain multiple targets … I have set to only deploy to one target at a time …

but its running them in parallel ? … i do get this warning "You have defined variables either on this project or in a variable set used by this project that override the values entered in the setup of this step. The most likely cause is that you are using a step template that has variables with the same name in its definition. We recommend either adding a prefix to your step template variables, or changing the names of the variables on your project. The conflicting variables are ‘Octopus.Action.MaxParallelism’. For more information, see
To log this warning as verbose instead, add the ‘OctopusSuppressDuplicateVariableWarning’ variable to your project with a value of ‘true’. "

This variable is set on the project but i would have thought setting this directly in the step would override that behavior …

the main issue is the azure script tries setting application gateway config in azure and if both are running they try doing the same thing at the same time and that causes issues… if one of the roles succeeds the next will just skip each section as the config will already exist so we need to run them in sequence



Hi, thanks for getting in touch.

Looks like you are getting the behaviour of running parallel steps because there’s those two definitions of the variable, and the one set to 1 isn’t the one getting resolved.

Could you tell me a little more about why you are setting Octopus.Action.MaxParallelism for the project? That might let me know what some other options are.

Also, I’m unsure about what you described as the desired behaviour of the script - if there’s parts that only run once for all the targets in the role, why not split that out into a separate script in a previous step that only runs once (for example, a script with run on the “Octopus Server” selected)?


hi Michael,

i am working as a contractor so i will ask Ref the variable being set on the project … but i believe this is cause they have lots of steps running in paralleled so they limit the max amounts … the reason we select run on the octopus server (on behalf of roles) is due to variables needing to be passed as A. App server or B. iWeb server … each pass the script defined variables (we use step templates to do this so having 3 steps doing the same thing but as individual scripts kind of goes against step templates)… the issue is cause there are 2 servers based in the app role trying to do the same thing at the same time … if one runs and sets everything (it’s a one time setup) the second server will see the config exists and skip doing anything … and both will skip on the second deployment… hope that helps

To assist more here’s a snippet of the code


if(!($loadBalancer | Get-AzureRmLoadBalancerProbeConfig -Name $httpProbeName -ErrorAction SilentlyContinue)){
Write-Host " [$httpProbeName] - setting http probe config…"
Add-AzureRmLoadBalancerProbeConfig -LoadBalancer $loadBalancer -Name $httpProbeName
-Protocol Http -Port $httpPort
-IntervalInSeconds 5 -ProbeCount 2
-RequestPath “/probe.html” | Set-AzureRmLoadBalancer | out-null
Write-Host " [$httpProbeName] - http probe config set " -ForegroundColor DarkYellow
} else {
Write-Host “[$httpProbeName] - Already exists”

as you can see there are variables in there that get passed and set depending on Role… so app server role would pass $loadbalancer as “LB-BTAPP” - iWeb would be “LB-BTiWEB” etc

When running the release we get this

… A question would be if they are global variables would setting this variable on a step for the above reason effect the rest of the project ? if not why can the project variable not be over ridden on a step (like scoping variables) the most scoped variable is used…

Hi, sorry for the delay here.

We’ve discussed this a little internally and feel that the issue is that we are asking two things of the one variable. I’ve put up an issue suggesting an enhancement to split out the two meanings of this variable. That would avoid the kind of situation you are in.

However, that’s not going to help you right now. So I’m wondering what’s the best way to get you moving forward. It’s worth investigating the reason why it’s set at the project level. If it can be removed from the project settings, then that should solve the problem.

If unsetting it at the project level really slows down the deployment process, then maybe there’s too much happening at once on the machine and it could be worth picking through the things that are happening in parallel and seeing if it needs to be that way or could be more efficient if the steps ran one after the other. Lastly, we have a new feature we are calling ‘Workers’ coming out in the next month. That will allow some work like this to be moved off the Octopus server and onto other machines, so that might be able to reduce the load on the server.


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