Retention Policies not run on Linux Tentacle targets at the end of deployments

I have Octo projects that are not running the retention policy step for their deployments. The life cycles being used are set to retain 1 release on the tentacles, and I’ve verified the Octo projects in question are using the right life cycle in the channel. However the deployment is not including the retention policy at all. The deploy status page- where each deploy step is given a green check mark as it completes- should have “apply retention policy” at the bottom, but that’s not being included.

I’m wondering if it’s because the deploy targets in this case are linux tentacles. The retention policies are being run as expected on all our windows tentacles.

Hi @matthew.douston,

Thanks for getting in touch with us, and sorry to hear you’re experiencing that behavior with retention policies on Linux tentacles.

I’m not sure yet what might be causing this, but if you can provide us with a few more details from your deployment process that should help us to further troubleshoot this issue.

Would you be willing to provide us a copy of your deployment task log for the Linux tentacles from Project > Tasks > (deployment) > Task Log > Download?

Also, if you could provide us with a JSON output of your process/steps for the Linux deployment that would help us further investigate and test on our end. You can find this under Project > Process > 3 dots in upper right > Download as JSON.

You can Direct Message me a copy of the deployment task log and JSON process, or we can provide you with a secure link to upload it.

I’m looking forward to hearing back from you.

Best,
Patrick

I’ve messaged you the requested logs privately.

Hi Matthew,

Thanks for sending those files through. I’m in the process of reviewing them and will get back to you shortly with any findings or updates.

Best,
Patrick

Hi @matthew.douston,

Sorry for taking a bit to get back to you, but I’ve been looking into this on my end.

I’m not seeing anything out of the ordinary with your process or in the log you’ve sent, and I haven’t managed to reproduce the behavior locally.

It’s interesting (as you noted) that the log contains nothing about the retention policy even running, so I was wondering how the lifecycle associated with your project is configured. Is it by chance set up with phases? You can find this by going to Library > Lifecycles and expanding the ‘Phases’ section. It might be good to send us a screenshot of these and possibly the retention policy on the lifecycle.

Also, are you able to provide us with a task log from the Windows tentacle deployments and what the lifecycle retention and phases look like there?

Best,
Patrick

Here’s a screen cap of the life cycle in use. It is using phases, but I’m not sure how or why this configuration wouldn’t trigger a retention policy.

I will email you directly a task log to a Windows target with the retention policy in it.

Hi @matthew.douston,

Thanks for providing those details, and I agree that configuration looks like it should be working.

I was wondering if you’d be able to try the problematic deployment against a test Windows target and see if the retention policy for this same project runs there? That would help us determine if it’s down to the operating system.

Also, would I be able to get the version of tentacle you’re using? It could be I’ve tested a different version that isn’t experiencing this issue, so I want to make sure I’m doing a like for like comparison. You should be able to get this by running tentacle version on the Linux machine.

Best,
Patrick

The command “tentacle” is not found on the target linux VM. It is, however, set up as a Tentacle in our Octopus Infrastructure. When I look in its “Connectivity” tab, it says the Tentacle version is 0.0.0.

I also fiddled with the plan such that I could deploy it to a Windows VM. Even then, the retention policy did not show up on the deployment status page where it should have (where you can expand each deploy step’s logs, where the retention policy should show up at the end).

Hi Matthew,

Thanks for testing that, and it’s interesting to see this behavior on a different tentacle with a different operating system.

It’s possible there may be some sort of issue with your project, so I was wondering if you’d be able to test creating a blank project with just a simple ‘Deploy a Package’ step to the Linux tentacle and see if the retention policy triggers after that? If so, let me know what the result is here.

If the policy does trigger, the next step may be to try re-creating or cloning the steps across from the existing project into a new one. Sorry if that’s inconvenient, but it may be the best workaround at this point.

Best,
Patrick

That worked!

I made a fresh new deploy project and set it up to deploy the same package via the same lifecycle to the same linux tentacle target… and the life cycle step showed up on the deploy status page.

I’m going to remake the projects that aren’t triggering the retention policies and see what happens.

Hi @matthew.douston,

That’s great news and thanks for letting us know that worked! I’ll keep the topic open for now, and let us know how it goes with the other projects.

Best,
Patrick

I figured it out!

The deploy plans that aren’t applying retention policies have “OctopusUseRawScript: True” set as a plan variable. The fresh plans I made from scratch, while I was testing them, were applying retention policies until I added this plan variable to them.

Based on the documentation on Octopus raw scripting, I understand why the retention policy wasn’t being ran- raw scripting bypasses Calamari entirely: Raw scripting - Octopus Deploy

Hi @matthew.douston,

It sounds like you’ve identified exactly the issue, and thanks for letting us and others know what was causing it.

Out of curiosity, did your use case require using raw scripting and you’re now having to work around that, or is this no longer needed?

Best,
Patrick

I’m not sure if raw scripting was needed for the projects I fixed. I didn’t create them. My guess is OctopusUseRawScript was set to true to get around VMs potentially not yet being configured fully. We did switch a number of linux SSH targets to linux Tentacle targets recently, and I can see why OctopusUseRawScript would be useful for older linux targets.

Since removing this var from all the deploy plans that had it, I’ve successfully redeployed new releases to dev and qa environments.

Hi @matthew.douston,

Thanks for getting back to me and letting me know. It makes sense if they were old SSH targets and switched over, so that lines up!

Glad to hear your deployments are still working properly and the retention policy is running again.

Best,
Patrick

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