2018.3.9 variable substitutions broken in GitHub Scripts

I have just upgraded to 2018.3.9 and now all of my deployment scripts have broken. I pull all of my functionality from GitHib as scripts. These scripts used octopus variable tokens in them #{varable.name} which was working fine. However now none of these variables are being replaced and all of my deployments now fail.

Hi Stephen,

Thanks for getting in touch! I’m sorry to hear you’re hitting this roadblock! Unfortunately I can’t tell what the issue could be as of yet, and we haven’t any other reports like this. Would you be willing to provide a copy of your verbose deployment log with debugging variables enabled? I’ll be happy to look through them and help find what’s going on here. You can refer to the following doc page on producing and exporting this log.

I look forward to hearing back and getting to the bottom of this!

Best regards,

Kenny

Attached is the raw log. A couple of octopus versions ago this worked as we rolled out to our dev tier. When we tried to promote the package to the QA tier (after updating octopus) we started to see the issues.

The script that the Step template runs (stored in GitHub) is as follows

Write-Host “----------------------------”

Write-Host “- Set Service Failure Mode -”

Write-Host “----------------------------”

$cmd = “sc.exe failure ‘#{serviceName}’ reset=#{reset} actions=#{action1}/#{delay1}/#{action2}/#{delay2}/#{action3}/#{delay3}”

Write-Host $cmd

Invoke-Expression $cmd

Write-Host “--------------------------------------------------”

The step template definition

{

“Id”: “ActionTemplates-82”,

“Name”: “Set Service Failure Mode”,

“Description”: “Set the failure modes for a service”,

“ActionType”: “Octopus.Script”,

“Version”: 4,

“CommunityActionTemplateId”: null,

“Properties”: {

"Octopus.Action.Script.ScriptSource": "Package",

"Octopus.Action.Package.FeedId": "feeds-github",

"Octopus.Action.Package.DownloadOnTentacle": "False",

"Octopus.Action.Package.PackageId": "labs/Octopus.StepTemplates",

"Octopus.Action.Script.ScriptFileName": "Set-Service-Failure-Mode.ps1"

},

“Parameters”: [

{

  "Id": "6635ae31-3c53-43f9-9784-d5326ce35ef6",

  "Name": "serviceName",

  "Label": "Service Name",

  "HelpText": "Name of the service to set the failure mode for",

  "DefaultValue": "",

  "DisplaySettings": {

    "Octopus.ControlType": "SingleLineText"

  },

  "Links": {}

},

{

  "Id": "e6d11cae-1ca4-4555-81ae-3c3c8a729284",

  "Name": "reset",

  "Label": "Reset Count",

  "HelpText": "Length of period of no failures (in seconds) after which to reset the failure count to 0",

  "DefaultValue": "0",

  "DisplaySettings": {

    "Octopus.ControlType": "SingleLineText"

  },

  "Links": {}

},

{

  "Id": "fe84a2e6-a6af-42ac-b260-33c6ace7e1ca",

  "Name": "action1",

  "Label": "First Failure Action",

  "HelpText": "The action undertaken in the event of a failure",

  "DefaultValue": "restart",

  "DisplaySettings": {

    "Octopus.ControlType": "Select",

    "Octopus.SelectOptions": "restart|restart\nrun|run\nreboot|reboot"

  },

  "Links": {}

},

{

  "Id": "c0da6583-67a7-4f5e-aa39-ad7b70ad4c94",

  "Name": "delay1",

  "Label": "First Failure Delay",

  "HelpText": "Delay time in ms before action executed",

  "DefaultValue": "1000",

  "DisplaySettings": {

    "Octopus.ControlType": "SingleLineText"

  },

  "Links": {}

},

{

  "Id": "63994495-2fd5-4be1-abd2-f098f6f031e8",

  "Name": "action2",

  "Label": "Second Failure Action",

  "HelpText": "The action undertaken in the event of a failure",

  "DefaultValue": "restart",

  "DisplaySettings": {

    "Octopus.ControlType": "Select",

    "Octopus.SelectOptions": "restart|restart\nrun|run\nreboot|reboot"

  },

  "Links": {}

},

{

  "Id": "bd700087-9c70-4fe0-b577-dee0d460bf8e",

  "Name": "delay2",

  "Label": "Second Failure Delay",

  "HelpText": "Delay time in ms before action executed",

  "DefaultValue": "1000",

  "DisplaySettings": {

    "Octopus.ControlType": "SingleLineText"

  },

  "Links": {}

},

{

  "Id": "ccf92e50-2e4d-4f11-9a07-62d0122ea644",

  "Name": "action3",

  "Label": "Subsequent Failure Action",

  "HelpText": "The action undertaken in the event of a failure",

  "DefaultValue": "restart",

  "DisplaySettings": {

    "Octopus.ControlType": "Select",

    "Octopus.SelectOptions": "restart|restart\nrun|run\nreboot|reboot"

  },

  "Links": {}

},

{

  "Id": "831d4b23-b527-4467-8529-d6a62e253a7c",

  "Name": "delay3",

  "Label": "Subsequent Failure Delay",

  "HelpText": "Delay time in ms before action executed",

  "DefaultValue": "1000",

  "DisplaySettings": {

    "Octopus.ControlType": "SingleLineText"

  },

  "Links": {}

}

],

“$Meta”: {

"ExportedAt": "2018-04-05T08:15:01.558Z",

"OctopusVersion": "2018.3.9",

"Type": "ActionTemplate"

}

}

ServerTasks-28474.log.txt (270 KB)

Hi Stephen,

Thanks for sending your logs.

This is a bug, I have created a GitHub issue that you can track and contribute to: https://github.com/OctopusDeploy/Issues/issues/4460. You can workaround the bug for now by adding the variable Octopus.Action.UseNewExecutionDispatcher to your project with a value of false.

Cheers,
Shane

Hi Stephen,

In the process of shipping a fix for this, it should be fixed in 2018.3.12. Please let me know if it resolves the issue for you.

Cheers,
Shane

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