Trigger fails on newly added deployment nodes

We are using trigger to configure a newly created node with deployments
But when our node is registered on Octopus - triggers start deployment
but due to our workflow, we have to reboot just after octo registration which causes all triggered deployments to fail

Is there a workaround for this?

Hi @Naman.Kumar,

Thanks for getting in touch!

I’m assuming that you’re using a deployment target trigger for this scenario?

The smoothest option here would be to alter the workflow to perform the reboot before running the register-with command. The other tentacle commands that create the tentacle instance on the machine can be run before the reboot without a problem, though.

If it isn’t possible to alter the workflow, the other options are not foolproof.
You could try adjusting the Event Filter of the Trigger to Machine found healthy instead of the entire event group.
e.g.

This may delay the trigger long enough for the restart to run before the deployment is triggered; however, this isn’t guaranteed, and you would need to test this a little.

Another option would be to run an API script to disable the new target immediately following the Register-with command and before the restart. A script like this one may work.
Again, this isn’t guaranteed to work as it relies on the disable script running before Octopus detects the new machine and runs the trigger.

Ultimately, performing the register-with command after the reboot is the safest option.

Regards,
Paul