Chain Deployments

(j.steensma) #1

This topic has been covered several times but no definitive answer has ever been given. Nothing I try is working. In another post, Kenneth suggests using the ‘Deploy a Release’ Step template. I can’t find this one. Does it still exist?

We are using the chain deployment tool to create a Server Provisioning script. I want this script to set up a whole server and deploy everything to that server in one big script. I’ve been playing with it for a while now.

I managed to get it to deploy to a single node but I had to use this setting.

Now I need to deploy to an environment that has multiple nodes this setting does not work because both nodes are trying to create a new release. The first on succeeds but the second one fails because it is trying to use the same Release Version number. OK. I get that. Another post said that it was better to use the ‘Run on the Octopus Server’ setting anyway. And this is where the issue is.

So it looks like I need Chain Deployments to work with this setting.

image

However, every time I get this error.

== Failed: Step 10: Deploy Applications www188 ==

17:12:52   Fatal    |     The step failed: This task has been canceled.

17:12:52   Info     |     The operation was canceled.

                    |   

                    |     Failed: na-tst-OCT-UGRD

17:12:52   Fatal    |       The action Chain Deployment - Enrolment and Planning on na-tst-OCT-UGRD failed

                    |     

                    |       Failed: Chain Deployment - Enrolment and Planning (on the Octopus Server)

17:12:29   Verbose  |         Octopus Server version: 2019.6.5+Branch.tags-2019.6.5.Sha.e406f9b14c6fb8a4c379b8b7c2db952d29a7a21a

17:12:29   Verbose  |         Environment Information:

                    |         OperatingSystem: Microsoft Windows 10.0.14393

                    |         OsBitVersion: x64

                    |         Is64BitProcess: True

                    |         CurrentUser: STAFF\scv-octopus

                    |         MachineName: NA-TST-OCTOPUS

                    |         ProcessorCount: 1

                    |         CurrentDirectory: C:\WINDOWS\system32

                    |         TempDirectory: C:\Users\scv-octopus\AppData\Local\Temp\

                    |         HostProcessName: Octopus.Server

                    |         PID: 6556

17:12:29   Verbose  |         Executing Chain Deployment - Enrolment and Planning (type Run a Script) on Octopus Server

17:12:29   Verbose  |         Using Calamari 4.21.2

17:12:29   Verbose  |         Running this script in the Octopus Server security context (STAFF\scv-octopus)

17:12:29   Verbose  |         Starting C:\WINDOWS\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'E:\Octopus\Work\20190828071229-21931-8' using 'OEM United States' encoding running as 'STAFF\scv-octopus' with the same environment variables as the launching process

17:12:30   Verbose  |         Octopus Deploy: Calamari version 4.21.2

17:12:30   Verbose  |         Environment Information:

17:12:30   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.14393.0

17:12:30   Verbose  |         OsBitVersion: x64

17:12:30   Verbose  |         Is64BitProcess: True

17:12:30   Verbose  |         CurrentUser: STAFF\scv-octopus

17:12:30   Verbose  |         MachineName: NA-TST-OCTOPUS

17:12:30   Verbose  |         ProcessorCount: 1

17:12:30   Verbose  |         CurrentDirectory: E:\Octopus\Work\20190828071229-21931-8

17:12:30   Verbose  |         TempDirectory: C:\Users\scv-octopus\AppData\Local\Temp\

17:12:30   Verbose  |         HostProcessName: Calamari

17:12:30   Verbose  |         Performing variable substitution on 'E:\Octopus\Work\20190828071229-21931-8\Script.ps1'

17:12:30   Verbose  |         Parsing file 'E:\Octopus\Work\20190828071229-21931-8\Script.ps1' with Octostache returned the following error: `The following tokens were unable to be evaluated: '#{GuidedFailureActionIndex}', '#{GuidedFailureAction}'`

17:12:31   Verbose  |         Executing 'E:\Octopus\Work\20190828071229-21931-8\Script.ps1'

17:12:31   Verbose  |         Name                           Value

17:12:31   Verbose  |         ----                           -----

17:12:31   Verbose  |         PSVersion                      5.1.14393.3053

17:12:31   Verbose  |         PSEdition                      Desktop

17:12:31   Verbose  |         PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}

17:12:31   Verbose  |         BuildVersion                   10.0.14393.3053

17:12:31   Verbose  |         CLRVersion                     4.0.30319.42000

17:12:31   Verbose  |         WSManStackVersion              3.0

17:12:31   Verbose  |         PSRemotingProtocolVersion      2.3

17:12:31   Verbose  |         SerializationVersion           1.1.0.1

17:12:32   Info     |         Setting Proxy Environment Variables

17:12:32   Verbose  |         PowerShell Environment Information:

17:12:32   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.14393.0

17:12:32   Verbose  |         OsBitVersion: x64

17:12:32   Verbose  |         Is64BitProcess: True

17:12:32   Verbose  |         CurrentUser: STAFF\scv-octopus

17:12:32   Verbose  |         MachineName: NA-TST-OCTOPUS

17:12:32   Verbose  |         ProcessorCount: 1

17:12:32   Verbose  |         CurrentDirectory: E:\Octopus\Work\20190828071229-21931-8

17:12:32   Verbose  |         CurrentLocation: E:\Octopus\Work\20190828071229-21931-8

17:12:32   Verbose  |         TempDirectory: C:\Users\scv-octopus\AppData\Local\Temp\

17:12:32   Verbose  |         HostProcessName: powershell

17:12:33   Verbose  |         TotalPhysicalMemory: 8388016 KB

17:12:33   Verbose  |         AvailablePhysicalMemory: 5837868 KB

17:12:33   Verbose  |         Checking API compatibility

17:12:33   Warning  |         Octopus web request (GET: https://www888-tst.xxxxxxx.xxx.au/api/) failed & will be retried in 30 seconds:

17:12:33   Warning  |         The underlying connection was closed: An unexpected error occurred on a receive.

17:12:52   Verbose  |         Process C:\WINDOWS\system32\WindowsPowershell\v1.0\PowerShell.exe in E:\Octopus\Work\20190828071229-21931-8 exited with code -1

17:12:52   Verbose  |         Updating manifest with output variables

17:12:52   Verbose  |         Updating manifest with action evaluated variables

17:12:52   Fatal    |         The remote script failed with exit code -1

So out of that the lines I’m interested in is:

Octopus web request (GET: https://www888-tst.xxxxxxx.xxx.au/api/) failed & will be retried in 30 seconds:

17:12:33   Warning  |         The underlying connection was closed: An unexpected error occurred on a receive.

Of course, it tries again for a few time… but who has time for that?

In the comments to the step template it says:

Available Settings:
- DebugLogging - set to ‘True’ or ‘False’ to log all GET web requests
- GuidedFailureMessage - will change the note used when submitting guided failure actions, the following variables will be replaced in the text:
#{GuidedFailureActionIndex} - The current count of interrupts for that step e.g. 1
#{GuidedFailureAction} - The action being submitted by the step e.g. Retry
- DeploymentRetryCount - will override the number of times a deployment will be retried when unsuccessful and enable retrying when the failure option is set for a different option, default is 1
- StepRetryCount - will override the number of times a deployment step will be retried before before submitting Ignore or Abort, default is 1
- RetryWaitPeriod - an additional delay in seconds wait before retrying a failed step/deployment, default is 0
- QueueTimeout - when scheduling a deployment for later a timeout must be provided, this allows a custom value, default is 30:00, format is hh:mm
- OctopusServerUrl - will override the base URL used for all web requests, making it possible to chain deployments on a different Octopus instance/server, or as a workaround for misconfigured node settings

I have been using an environment variable


but it is the last part of this statement that interests me. “a workaround for misconfigured node settings”. What misconfiguration is this talking about?

In another post, I saw a suggestion to check that the tentacle servers could access the Octopus Server API. I have done this and there is no problem. I can query the API from the swaggerui page on the Tentacle servers. The same is true on the server itself. I can query the Octopus API from the swaggerui page from the Octopus server.

I have tried using https://localhost/ for the environment variable. Same error.

I have look at the firewall settings and nothing is being blocked on either side.

I’m really not sure where to goto from here. Does anyone have any ideas?