How are System Variables picked?

Hi Octo team,

In most of my Octo tentacles,
Installation directory - "C:\Program Files\Octopus Deploy\Tentacle"
Apps path - “D:\Octopus\Applications”.

On some Octo agents,
Installation directory - "C:\Program Files\Octopus Deploy\Tentacle"
Apps path - “D:\Data\Octopus\Applications”.
(Not sure who did it & how it was done).

Both tentacles are deploying apps in correct folders and working as expected.

I have a PS step template that needs this path, so I used #{Octopus.Tentacle.Agent.ApplicationDirectoryPath}
(refer - System variables - Octopus Deploy)

It works without any problem on the former. However, on latter script fails as it still refers to "D:\Octopus\Applications"

So how is this scenario possible?

p.s. - On latter there is a config D:\Data\Octopus\FIDPLAT-Tentacle\Tentacle-FIDPLAT-Tentacle.config

<?xml version="1.0" encoding="utf-8"?>
<octopus-settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <set key="Octopus.Home">D:\Data\Octopus\FIDPLAT-Tentacle</set>
  <set key="Tentacle.Communication.TrustedOctopusServers">[{"Thumbprint":"B620424FC75BA241DD7D526CBD18E59EA73A4DF6","CommunicationStyle":1,"Address":null,"Squid":null,"SubscriptionId":null}]</set>
  <set key="Tentacle.Deployment.ApplicationDirectory">D:\Data\Octopus\Applications\</set>
  <set key="Tentacle.Services.NoListen">false</set>
  <set key="Tentacle.Services.PortNumber">10933</set>
</octopus-settings>

I tried by putting my variable in this and restarted the tentacle service. Still no joy.

<set key="Tentacle.Agent.ApplicationDirectoryPath">D:\Data\Octopus\Applications\</set>

Could you help me with this pls?
Thanks

Hi @Nikhil_Agrawal,

Thanks for reaching out.

I would like to clarify a bit before we dig in.

Both tentacles are deploying apps in correct folders and working as expected.

Does this mean that the first set of tentacles is deploying correctly to D:\Octopus\Applications and the second set is deploying to D:\Data\Octopus\Applications?

It works without any problem on the former. However, on latter script fails as it still refers to "D:\Octopus\Applications"

By this, do you mean that the second set who’s app path is D:\Data\Octopus\Applications the system variable shows D:\Octopus\Applications incorrectly?

I tried by putting my variable in this and restarted the tentacle service. Still no joy.

You shouldn’t need to add the extra line to the config.

Are you trying to change the applications directory to be the same as the first set of tentacles, or are you trying to keep it in the different applications folder and have the tentacles in question use that directory when using that system variable?

Can you please tell me which version of Octopus Server and Tentacle you’re on? Are these deployments with the weird system variable behavior deploying to both sets of tentacles at once, or just one set or the other?

Please let me know.

Best,
Jeremy

Hi @jeremy.miller,

Thanks for replying. Pls, find my replies inline.


[NA] Both tentacles are deploying apps in correct folders and working as expected.

[JM] Does this mean that the first set of tentacles is deploying correctly to D:\Octopus\Applications and the second set is deploying to D:\Data\Octopus\Applications?

[NA] Yes, exactly.


[NA] It works without any problem on the former. However, on latter script fails as it still refers to "D:\Octopus\Applications"

[JM] By this, do you mean that the second set who’s app path is D:\Data\Octopus\Applications the system variable shows D:\Octopus\Applications incorrectly?

[NA] Yes. The PS step template has a system variable placeholder. The release fails in the second set as it is still searching at D:\Octopus\Applications


[NA] I tried by putting my variable in this and restarted the tentacle service. Still no joy.

[JM] You shouldn’t need to add the extra line to the config.

Are you trying to change the applications directory to be the same as the first set of tentacles, or are you trying to keep it in the different applications folder and have the tentacles in question use that directory when using that system variable?

[NA] I am trying to keep it in different app folders and have the tentacles in question using that directory when using that system variable.


[JM] Can you please tell me which version of Octopus Server and Tentacle you’re on? Are these deployments with the weird system variable behavior deploying to both sets of tentacles at once, or just one set or the other?

[NA] Octo Server - v2019.12.0-LTS
Tentacle - 5.0.12
We have 1 server from both sets in an environment - Dev/UAT/Live. So a total of 6 servers.


Thanks,
Nikhil Agrawal

Hi @Nikhil_Agrawal,

Thanks for the detailed answers.

Apologies for this, I should have asked for it before I signed off yesterday, can you please direct message me a copy of the deployment process JSON? To get this go to the Project, then the process section, then click the 3 dots to the right of add step and click download JSON.

Please also let me know the step in question causing the issue for you, and if the workers/targets in that step will be run on both the D:\Data\Octopus\Applications and D:\Octopus\Applications agents within one deployment.

Please let me know if you have any questions.

Best,
Jeremy

Hi @jeremy.miller,

This is sorted. The issue was some place else.

Thanks,
Nikhil

1 Like

Hi Nikhil,

Thanks for letting me know. I’m glad to hear you’re in a good state.

I hope you have a great weekend.

Best,
Jeremy

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