Retention policy not working

Octopus version 2021.1.7469
Retention policy was configured from Keep All to Keep Limited Number(3).
We follow Blue-Green deployment process.
The retention policy works on the Green Servers but not on the Blue servers

Logs from problematic Blue server

Keeping this deployment and the previous 3 successful deployments 
July 5th 2022 18:54:35Verbose
Keeping C:\Octopus\Applications\AwsProductionBlue\MedAdvisor.Redirect.My\5.28.113-Release and C:\Octopus\Files\MedAdvisor.Redirect.My@S5.28.113-Release@3C3B4F1944C46A438AAE4F0690B7124F.nupkg as it is the most recent successful release 
July 5th 2022 18:54:35Info
Did not find any deployments to clean up 
July 5th 2022 18:54:35Verbose
Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220705085437-1225966-394

Logs from good Green server

Keeping this deployment and the previous 3 successful deployments 
July 5th 2022 20:12:13Verbose
Keeping C:\Octopus\Applications\AwsProduction\MedAdvisor.Redirect.My\5.28.113-Release and C:\Octopus\Files\MedAdvisor.Redirect.My@S5.28.113-Release@92771B31D4DFD64A8E8E972BEAB1ADE7.nupkg as it is the most recent successful release 
July 5th 2022 20:12:13Verbose
Keeping C:\Octopus\Applications\AwsProduction\MedAdvisor.Redirect.My\5.28.110-Release and C:\Octopus\Files\MedAdvisor.Redirect.My@S5.28.110-Release@EFAF58477394CE4ABB531CB10F5E7585.nupkg as it is the 2nd most recent successful release 
July 5th 2022 20:12:13Verbose
Keeping C:\Octopus\Applications\AwsProduction\MedAdvisor.Redirect.My\5.28.108-Release and C:\Octopus\Files\MedAdvisor.Redirect.My@S5.28.108-Release@9D3F64A0E52B8B41BC0BA3249C20AEF3.nupkg as it is the 3rd most recent successful release 
July 5th 2022 20:12:13Verbose
Keeping C:\Octopus\Applications\AwsProduction\MedAdvisor.Redirect.My\5.27.91-Release and C:\Octopus\Files\MedAdvisor.Redirect.My@S5.27.91-Release@97B003EE338A424DB8A80F2748C68FC9.nupkg as it is the 4th most recent successful release 
July 5th 2022 20:12:13Info
Removing directory 'C:\Octopus\Applications\AwsProduction\MedAdvisor.Redirect.My\5.27.90-Release' 
July 5th 2022 20:12:13Info
Removing package file 'C:\Octopus\Files\MedAdvisor.Redirect.My@S5.27.90-Release@A0AB429197D1A7459833D1D91FC52E69.nupkg' 
July 5th 2022 20:12:13Verbose
Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220705101214-1226009-18579 exited with code 0 
July 5th 2022 20:12:13Verbose
Exit code: 0```

Hey @shuman.paul,

Thanks for reaching out, welcome to our community forum!

I’ve had a look over your post and it does seem that there are some inconsistencies between the servers, I have a couple of things that you could check, if you don’t mind?

  1. It seems simple, but are there packages in the directory on the blue server that are required to be cleared? If not, then it would explain why the retention policy is not removing those packages.
  2. Can you check the deployment journal on the tentacle/worker to see if any of the items that you’d expect to be cleared are in-fact on that list.

Please let me know in regards to the above and we can proceed with troubleshooting further with that information.

Kind Regards,
Adam

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