An action template version with this name and version already exists. To fix this problem you need to rename your template

usability
(Prateek P) #1

I’ve found a weird situation in OctopusDeploy around step templates.
Scenario - We had step templates with names A and B, which has been used for a quite long time and are on a different version, Now we had to change the name of the template A to B and B to A.

Octopus is not allowing to do this, We are getting An action template version with this name and version already exists

To have a workaround we are thinking of bumping the version of the new renamed template to the number greater than the old original template in the table ActionTemplate.

We want to confirm the impact of this, As we have to manually update the table ‘ActionTemplate’ and are unsure of the database structure to be satisfied that this is enough/correct.

(Daniel Fischer) #3

Hi @prateek.p,

Thanks for getting in touch! I think the best solution here would be to rename one of the templates to something else entirely before making the change.

For example, A to C, then B to A, then finally C to B. You may need to apply/update the templates usage between the changes to Octopus does not get caught up with the references.

If I am missing something here or this solution does not work, please let me know.

Looking forward to hearing from you.

Best regards,
Daniel

(Prateek P) #4

I think I did exactly what you are suggesting, Below are the steps I did for renaming the step template.

I had a template-A with name AWS - Create ACM Certificates - UI and template-B with name AWS - Create ACM Certificates - UI - FedRamp

We append Deprecated in the template A AWS - Create ACM Certificates - UI -DEPRECATED and then renamed template B as the same name as A which is AWS - Create ACM Certificates - UI.

All this step has been done successfully.

Now after a day when I am trying to modify the template B name - “AWS - Create ACM Certificates - UI”, It’s throwing an error saying You can’t modify an action template version with this name and version already exists to fix this problem-you-need-to-rename-your-template.

Attaching snapshots for your reference.

This is the ActionTemplateVersion table

This is the step template after we have renamed it from AWS - Create to AWS - Create ACM Certificates - UI - FedRamp to AWS - Create to AWS - Create ACM Certificates - UI. Note the version is 4.

This is showing that for our newly renamed step template there is already a version 4 (from the old step template before rename) in the ActionTemplateVersion table.

So, to me, the error is at the database level where the new name updated is clashing with the old name existing version.