Package installation is deleted right after deployment


I currently have a problem with my deployment setup. Here the scenario:

A project is setup to use a rolling deployment step with 7 sub-steps (2x Powershell, 5x Nuget).
I can create and deploy a release, but the last NuGet step is removing the (in the current deployment) installed package AND installation folder of the first Nuget package. Means, that the installation folder of the first package is empty after the deployment.

I attached the log file snipped that shows that the “LinkService” Nuget package is removing the installation and package of the “CHG.TESMA” package.

The retention policy for this project is set to “Keep last 3 builds”. (every category)

Do you have a hint what could be wrong here?

Thanks a lot!

Octopus Version:

log.txt (2 KB)

I just did a little more investigation. It looks like as the retention policy is not considered per package (or child-step) but for the “main-step”. This means if you are using child steps to perform a rolling deployment, all packages that are deployed in the child step will be considered the same for the retention policy. If there are more child steps than the amount of releases in the retention policy the first deployed packages are deleted immediately after the deployment is finished.

I attached a picture (bugreport01) in which I tried to visualize the behaviour. Step 2.2 is executed, but is deleted afterwards due to the retention policy (I think).

Another sample is shown in (bugreport02). Also a rolling deployment with 2 child-steps. You can deploy several times and the current release is not deleted. But also the retention policy is causing that the packages ( are deleted after the 3rd deployment.

My expectation would be that the retention policy should be applied per package and not per (main-) step?!

Best regards,

Thank you for tracking this down, it’s an absolute gem of a find. I’ve fixed it and we’ll have the patch out in 2.4, which is coming in preview form shortly.

In the short term, lengthening retention is the only available workaround.

Thanks again,