Octopus.Machine.Hostname system variable not available on transient target

Timbo's Avatar

Timbo

18 Jan, 2018 07:11 AM

Hello Octopus Community!

We use transient targets (i.e. they are only created/started on a new deployment), meaning some targets don't exist (or are not running) when I click the "Deploy" button - one of the steps creates or starts the target up. After the target is running and available, the "Health Check" step is run to discover the "New Deployment Targets". Then I can perform actions on this target thereafter, unless I depend on the "Octopus.Machine.Hostname" System Variable that is...

To reproduce (manually):
1. Create a "Target Role" that is not associated with an active "Deployment Target" (Say a disabled Cloud Region)
2. Create a project with a "Manual Intervention Required" step - during which you would register a new "Deployment Target" with the "Target Role" created in Step 1. (this would normally be automated via Powershell installing the tentacle on the target, then the target registering itself with the OD Server)
3. Progress the deployment onto the "Health Check" step, which has the "Health check errors" setting set to "Skip deployment targets that are unavailable", and set the "New Deployment Targets" setting to "Include new deployment targets in the deployment". This should make the newly registered "Deployment Target" available as part of the "Target Role" (Step 1) for any subsequent step.
4. In a subsequent step, attempt to use the "Octopus.Machine.Hostname" system variable in a step and it will not work, it just resolves as "#{Octopus.Machine.Hostname}"
5. Run the deployment again (either a new deployment or "Try Again"), and the "Octopus.Machine.Hostname" system variable will resolve properly. Note: I'm running the step "On the Octopus Server on behalf of "Target Role" (Step 1)"

I'm running Octopus Server 4.1.9, and Tentacles 3.16.3 (Both the latest releases at time of writing), and I've tried "Updating Calamari" on all the targets before hitting the "Health Check" step too.

This isn't a huge issue, it just means I need to run initial deployments twice, but you know, it's killing my "flow" OCD.

Thanks for reading!

-Timbo

  1. Support Staff 1 Posted by Tom Williams on 22 Jan, 2018 01:56 PM

    Tom Williams's Avatar

    Hi Timbo,

    Thanks for reaching out and sorry to hear you have hit this issue with Octopus.
    We have reproduced this issue on our end and I have raised an issue for it which can be tracked here.

    Thanks again for bringing this issue to our attention, hopefully we will be able to fix it soon.

    Kind Regards,
    Tom W

  2. 2 Posted by Timbo on 28 Jan, 2018 11:56 PM

    Timbo's Avatar

    Thanks for looking into it.

    -Timbo

  3. Timbo closed this discussion on 28 Jan, 2018 11:56 PM.

  4. Timbo re-opened this discussion on 09 Feb, 2018 03:24 AM

  5. 3 Posted by Timbo on 09 Feb, 2018 03:24 AM

    Timbo's Avatar

    Hi Tom,

    Glad to see this issue was resolved so quickly, but I think there's still a problem.

    To replicate; Create a deployment just like you did in Issue #4196, except add TWO new targets during the manual intervention.

    Set the final script step to print "Octopus.Machine.Name" and/or "Octopus.Machine.Hostname", and you'll see that it only prints one specific machine's variables. No matter how many machines are being targeted in that step, they will all print the one machines variables.

    I've attached the deployment log, and a screenshot if it helps.

    Thanks!

    -Timbo

  6. Support Staff 4 Posted by Tom Williams on 19 Feb, 2018 08:31 AM

    Tom Williams's Avatar

    Hi Timbo,

    Sorry for the delayed response.
    Thanks for reporting this issue, I have submitted a fix for it, which can be tracked from the GitHub issue here, hopefully it will be merged in the next couple of days, and should go out in an upcoming release.

    Kind Regards,
    Tom W

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac