Updating a Step Template in a Process fails silently

Checking now…

made a change to a notes field and there is now a commit for “Octopus Schema Migration to v5” :slight_smile:
This has a single file change to schema_version.ocl so it now contains:
version = 5

When I try the “Update and Commit” I get a different error

A 400 is returned from a POST to /api/Spaces-1/actiontemplates/ActionTemplates-6/actionsUpdate

Request Content:

{
    "ActionsToUpdate" : [{
        "ProcessId" : "deploymentprocess-Projects-1",
        "ProcessType" : "Deployment",
        "ActionIds" : [
            "sql-ensure-login-azure"
        ],
        "GitRef" : "17390_CheckForSqlConnectionLeak"
    }],
    "Overrides" : {
    },
    "DefaultPropertyValues" : {
    },
    "Version" : 8
}

Response Content:

{
  "ErrorMessage": "There was a problem with your request.",
  "Errors": [
    "Remote repository returned an error: unpacking the sent packfile failed on the remote"
  ],
  "ParsedHelpLinks": [],
  "Details": {}
}

The UI displays this as an error message:
An unexpected error occurred in Octopus v2022.3.7275-hotfix.8764: e is undefined

isActionUpdateResult@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:1:3289212 96917/k/this.mergeLatest/<@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:1:3282577 async42915/u/this.doBusyTaskInternal@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:571021 9143/provideErrorHandlingByName/this[e]@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:199516 42915/u/this.doBusyTask@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:570651 81190/Ae/this.doBusyForChildren@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:1:1923545 96917/k/this.mergeLatest@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:1:3282181 97518/onClick/t<@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:215170 onClick@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:215181 97518/getButton/S<@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:215677 41045/t/n.handleClick@https://howells.octopus.app/vendor-material-ui.01d6e2d2771b79ace610.hashedasset.js:2:702586 l@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:139147 f@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:139290 64448/g/<@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:139436 g@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:139522 it@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:155025 rt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:154835 at@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:155193 pt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:156400 oe@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:253103 se@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:142819 Qt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:162364 Kt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:161580 60053/t.unstable_runWithPriority@https://howells.octopus.app/vendor.06d35dde22e537a8c46b.hashedasset.js:2:1571351 Vo@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:183915 ne@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:252878 Xt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:161393 EventListener.handleEventYt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:161312 qt@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:161114 ft@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:156708 ln@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:164414 Za@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:215618 hs@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:235697 fs@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:235586 ds@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:235439 rs@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:232520 64448/$o/<@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:184206 60053/t.unstable_runWithPriority@https://howells.octopus.app/vendor.06d35dde22e537a8c46b.hashedasset.js:2:1571351 Vo@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:183915 $o@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:184153 Xo@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:184086 Zl@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:229309 enqueueSetState@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:187869 72408/w.prototype.setState@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:560358 stepIntoSpace@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:1469514 async*stepIntoSelectedSpaceId@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:1468917 switchToSpace@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:1468357 UNSAFE_componentWillReceiveProps@https://howells.octopus.app/app-main.43333e3ebcaf0d0c98d8.hashedasset.js:2:1467788 Ci@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:188951 Fa@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:207462 wl@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:244070 fs@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:235516 ds@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:235439 rs@https://howells.octopus.app/vendor-react.ebfc7b233129de93f86c.hashedasset.js:2:232520

Hi @rik.crompton

I’ve seen this error before when it’s related to the permissions on that branch. I can see you had this error before but managed to get past it. Can you double-check the permissions on that particular branch inside of Azure DevOps to see if they are correct?

I’ve updated our engineer to let them know that you have been able to get the new version, but you’re still seeing the 400 error you had originally. If the permissions are right, I’ll wait for them to reply and see what they say.

Sean

Which permissions will it need that it does not already have? I can see that my changes to the notes fields were committed successfully, and Octopus also managed to write an upgrate ot v5 commit. Is there something special it needs to do an “Upgrade and Commit”?

Hey @rik.crompton,

It does seem that you wouldn’t be able to make any commits to the repo if the permissions were incorrect, so Octopus must be doing something different or modifying the OCL in some way when using the Update and Commit button.

I wonder if, as a test, you would be able to clone the repo and link a new project to it, that way we would effectively have a brand new project within Octopus that has the exact same process as your main one.

Then, attempt to update the step template from within that project, to see if there are any left-over bad data points involved with the original.

Is this something you’d be able to try at all?

Kind Regards,
Adam

I’ll try that now…

I’ve forked the repo and setup a new Octopus project that is connected to it[1]
the Update and Commit button still produces an error

[1] Octopus Deploy

Hmmm… just noticed if I select the main branch in the new project I get the error message: “Sequence contains no matching element”.

The error does not appea with the branch 17390_CheckForSqlConnectionLeak

Hey @rik.crompton,

Thanks for checking that, that’s interesting… I wonder how that relates to the issue you’re experiencing…

It may be good that you’ve created this project and forked the repo, do you mind if I have a play around with that project and see what I can find at all?

Kind Regards,
Adam

Go ahead :slight_smile:

Hi @rik.crompton,

Strange question but does that forked repo have a main branch, or just the SQL branch?

Kind Regards,
Adam

Yes, it does have a main branch, and it looks like the relevant Octopus files are in the .octopus folder as expected. For some reason they don’t seem to be being read properly when loading the Process for the main branch. :-/

That’s strange, it’s likely something to do with the project cloning, I take it the main branch of the original project is accessible still?

Would you be able to test something, please?

In the deployment process OCL on the cloned repo, can you modify the template version of the step template from 7 to 8 manually inside the git repo to see if that change is reflected in Octopus?

Kind Regards,
Adam

Oh, it’s worth adding that it doesn’t need to be in all of the steps that use ActionTemplates-6, just in one of them.

I’ve just updated the SQL - Ensure Login - Azure step on the SIP project manually and then pushed the change. Seems to have worked OK! :slight_smile:

Note I did this on the main SIP project, not the cloned one

Hi @rik.crompton,

That’s good news! I take it Step 5 is still having issues updating, or could you try this one, too?

Kind Regards,
Adam

In regards to the errors in the cloned project, I wonder if there are references in the repo to the project ID or name that is bound to variables, as any reference to a project variable seems to throw that Sequence contains no matching element error.

You may have to do a search and replace on the cloned repo for any text that is:

“Projects-1” and replace it with “Projects-41”
“SIP” and replace it with “test-update-and-commit”

That should bring everything in line and allow you to view that main branch, in theory.

Kind Regards,
Adam

1 Like