Deployment do not respect Octopus.Deployment.SpecificMachines variable

Hello. I am using Octopus.Deployment.SpecificMachines variable to deploy only to the list of specific machines among available. However if I use variable with tenant tag in the project, it seems like my deployment do not respect Octopus.Deployment.SpecificMachines variable even though my deployment is untenanted. I can see deployment went to machines that are not in the list.

I have configured a project to test that behavior and shave off anything else that could affect the deployment. You can see in the screenshot that there are machines that are not in the Octopus.Deployment.SpecificMachines variable. Keep in mind that deployment is untenanted in this case. Also I can see that the value(A) of the variable is taken correctly. Then, if I delete variable with tenant tag scope deployment will proceed correctly.


This seems very strange and unrelated but maybe I do not understand something or there is a bug in there.

Thanks in advance,
Alexander.

Hi @avasin,

Thank you for contacting Octopus support and for the precise instructions for the issue.
It does look like a bug. Let me try to reproduce it in our environment.

Thanks,
Sergei

Thanks @sergei.dubovsky . Please, feel free to contact me if you need more details.

Hello @sergei.dubovsky Have you managed to reproduce the issue?

Alexander

Hi @avasin,

I am still working on the reproduction. Where do you define the value for the Octopus.Deployment.SpecificMachines?

Thank you
Sergei

Hello. It is configured in a variable set, through bunch of variables that we use to define deployment targets. Like this:

Octopus.Deployment.SpecificMachines = #{Octopus.Deployment.ServerSet[#{Deploy.TargetDeploymentSet}]}

Variable Octopus.Deployment.ServerSet[‘NameOfSet’] contains list of Machine IDs.

Alexander

Got it. Thank you. Let me get back to reproducing this.

Hello. Just getting back to you to check if you need anything else from me to reproduce the issue?

Alexander

Hi @avasin

Thank you. We are still working on this.

Hi @avasin,

I am getting lost in scopes and references. Will it be possible for you to export the varset to JSON?


Please be sure to redact any sensitive variables from the output.

Thank you.

Hi @sergei.dubovsky
Thanks for getting back to me. I have uploaded the file with project variables. There is more variables in library attached to the project. I have uploaded it as well.

If you would like, I can compile only the variables that is used by this test and put them into project for better understanding.

Alexander.

variableset-LibraryVariableSets-1384.json (118.2 KB)
troubleshooting-variable-scopes-project-variables.json (77.1 KB)

Hi @ avasin,
Thank you for the varset JSON. I am working on importing it into my instance.

I will update you on my findings.
Sergei.

Hi @avasin,

Thank you for keeping in touch, and for your report and details so far! I’ll jump in here for Sergei for the time being as he’s now offline as part of our US-based team.

Just a quick note that I’ve been able to reproduce this behavior locally, and I myself would lean towards this being a bug. I’m going to continue our discussion internally on this behavior, but as we do so and continue trying to better understand what’s going on here I thought I’d share a potential workaround I was able to implement while I was trying to simplify the situation as much as I could.

Instead of the layers of variable bindings to evaluate the machines to set this variable to, it looks like setting this Octopus.Deployment.SpecificMachines in the project and manually entering the machines you expect it to resolve for as they’re values, the unscoped value will evaluate correctly when there’s a tag-scoped value as well. In my example it looks like this:

It’s of course not ideal, but I’m hoping that might at least help get you unstuck. Let me know what you think or if you have any questions as we continue looking at this one.

Best regards,

Kenny

@Kenneth_Bates Thank you for your suggestion.
I trimmed everything down in the project and removed all of the variable sets from the project. Issue is still reproduceable, but much easier to understand:

  • Left only 1 machine in Octopus.Deployment.SpecificMachines
  • Empty value with tenant tag scope
  • Deploying untenanted and seeing deploy run on 3 machines instead of 1.

Alexander

1 Like

Hi Alexander,

Thank you for following up and providing those additional details. That was quite helpful, and I’ve been able to reproduce this in exactly the same way as you’ve shown. In short, this certainly still feels like a bug, which I will get reported shortly. The only way around this that I can figure out at this point is to use some other scoping on this tenant tag-scoped value to get it excluded from consideration here, like an additional environment-scope. Absolutely not an ideal solution, but I’ll get this bug raised and follow up with a link that you can track.

Best regards,

Kenny

Hi @Kenneth_Bates, thank you for suggested workaround. Is there any plans on fixing this issue in future releases?

Alexander

Hi @avasin,

We have a bug in the tracker for this issue: https://github.com/OctopusDeploy/Issues/issues/7325
You can keep an eye on its progress. So far it is still in triage.

Thank you.
Sergei

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