Cant delete a few old step templates

Hi Support. this is an old issue that fell off the radar last year when i got side tracked with some projects. I just updated to 2019.6.2 and the issue persists. When i try to delete some old step template it tells me it cant because there in use and it doesnt tell me whats using them. Below is the old thread where we have gone back and forth. I would like to get this resolved as we have a bunch of them in this state and i hate leaving trash around.
https://help.octopus.com/t/cant-delete-a-few-old-step-templates/19398/5

thanks
tim

Hi Tim,

We are currently making some changes which will hopefully address this for you. This change should make it much easier to find the relevant used locations of the template. It would also mean that you can simply detach or delete the step template in the associated project after which you can delete the step template. It may make sense to streamline this somewhat in the future, but we believe this would be a good first step. Would that resolve the problem for you?

We also have an issue which you can use to track progress.

Regards,
Shaun

Hi Shaun,

The feature sounds great and something I would love to have for some of our non-broken templates. My only worry here is in the screenshot it says ‘this is in use by: THIS RELEASE’ In our case it says ‘this is in use by: ‘ there is nothing
listed. This makes me thing something ‘bad’ happened to the database and there is a flag set but the full data structure is missing. If the code of the feature doesn’t care if things are missing and can unbind the template that’s fine but if it wants to make
sure it unbinds everything (which I would totally understand) I think we are going to end up in the same place were we have bad data and the code doesn’t know what to do.

Im happy to wait and give it a try (do you have an ETA?) but if you look at the old thread we have been told it should be fixed a few times and yet we are still here. Happy to send another copy of the database if you guys want to take a
fresh look or see how the new feature does with the data in your testing.

Thanks

tim

Hi Tim, thanks for getting back to us,

There is a good chance that something could have happened during a migration possibly in combination with a previous bug which we didn’t account for resulting in that behavior. We believe the changes should still help for your given scenario as the template seems to be referenced in a release. It may also be that we have a bug in how we determine the referenced templates from releases, which may explain why you get a blank list coming back. I would be more than happy to take a look at your database and confirm whether the changes do indeed fix the problem.

The fix is currently in review and should be released soon as part of either 2019.7.1 or 2019.7.2. I would however also like to see whether we can get this issue resolved for you without the need to upgrade.

Would you be able to upload a snapshot of your database, please? I have created a secure upload location which only Octopus staff can access. We scrub these databases of any personal identifiable information before accessing them. There is no need to provide your master key and therefore we won’t be able to decrypt any sensitive values.

Hope to hear back from you soon,

Regards,
Shaun

Thanks Shaun,

Export has been uploaded (sorry I might have done it twice). Please let me know if you need anything else from us and looking forward to the new build as there are some other templates I would like to clean up but don’t have time to chase
down all the old releases.

Thanks

tim

Hi Tim,

I have been unsuccessful in my attempts to import the provided bacpac file for some odd reason. Could you please upload a database backup (.bak) file if possible, please? You can use the previously created secure upload location to do so.

Regards,
Shaun

Hi Shaun, Sorry for the lag. I THINK the issue you are having is that you need to go to the sql server object in SSMS, properties, advanced, and set ‘Enable Contained Databases’ to true. Did that on my box and the import worked. Ill upload a backup as soon as it finishes zipping as well in case thats easier but im not clear if you will have the same problem with the system expecting the ‘Contained’ feature being on.
thanks
tim

Hi Tim,

We successfully restored your database and have found an orphaned deployment process snapshot that was used by a release (notice the like has %| and |% around the ActionTemplate Id)

select Id from DeploymentProcess d
where d.RelatedDocumentIds like '%|ActionTemplates-643|%'

returns

deploymentprocess-Projects-445-s-72-23JK3
deploymentprocess-Projects-445-s-72-2R9XR

Those snapshots are no longer used by any releases in that project. If you delete these manually that will allow you to remove that step template. You can delete those 2 orphaned deployment process snapshots by running these 2 queries:

delete from DeploymentProcess where Id = 'deploymentprocess-Projects-445-s-72-23JK3'
delete from DeploymentProcess where Id = 'deploymentprocess-Projects-445-s-72-2R9XR'

Please take a backup of the database before manually modifying any data in case we accidentally delete anything.

We’ll keep investigating why this has happened in the first place and thanks for your patience!

Cheers,
Frank

Thanks Frank. didnt want to start whacking things out of the database without you guys being ok with it but that did the job. cleaned up the stuck ones. We are good on this case, please close it out!
thanks again
tim

Glad that worked Tim!

Feel free to contact us if you have further issues.

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