Error: "TypeError: Cannot read properties of undefined (reading 'AcquisitionLocation')"

We host Octopus locally. Currently we are running version 2021.3.8275. A user was editing a step template and adding a variable. After they saved the change the step template can not longer be edited in the UI. Now we get this.


I can retrieve the template via the API attached.
ActionTemplate-3301.txt (4.8 KB)

Hi @lbrody,

Thanks for reaching out to Octopus support and I’m sorry to see you’re running into this issue with your step template. We were able to reproduce your error thanks to the template information you sent along. It appears that removing the package reference and saving the step template is what produces this error. You can see in the JSON you sent over that the PackageID is set to null.

Luckily tou should be able to fix this by updating the step template again using the Octopus Swagger UI.

First you should do a GET for the action template to ensure you have the properly formatted JSON.

Once you have the JSON you can make the following updates: See JSON example

  • Blank out the “Packages” array
  • Set “Octopus.Action.Script.ScriptSource”: = “Inline”
  • Update the template “Version” to 4
{
  "Id": "ActionTemplates-xxx",
  "Name": "Template Name",
  "Description": "Template description",
  "ActionType": "Octopus.AwsRunScript",
  "Version": 4,
  "CommunityActionTemplateId": null,
  "Packages": [],
  "Properties": {
    "Octopus.Action.Script.ScriptSource": "Inline",
    "Octopus.Action.Aws.AssumeRole": "True",
    "Octopus.Action.AwsAccount.UseInstanceRole": "False",
    "OctopusUseBundledTooling": "False",
    "Octopus.Action.AwsAccount.Variable": "",
    "Octopus.Action.Aws.AssumedRoleArn": "",
    "Octopus.Action.Aws.AssumedRoleSession": "",
    "Octopus.Action.Aws.AssumeRoleExternalId": "",
    "Octopus.Action.Aws.Region": ""
  },

Once you have your updated JSON you can do a POST to the /actiontemplates endpoint in Swagger UI.

I have logged a GitHub issue for this which you can watch if you would like to receive updates on the progress. Hopefully this information helps get your template up and running again and please let me know if you have any other questions for me.

Thanks!
Dan

I did that via the Api, worked like a charm. Thanks Dan.

Hi @lbrody,

That’s great news! Happy to help and please let us know if you need anything else.

Thanks,
Dan

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