Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Retention Policies on Runbooks are hardcoded to 90 days #7439

Open
1 task done
BobJWalker opened this issue Mar 18, 2022 · 4 comments
Open
1 task done

Package Retention Policies on Runbooks are hardcoded to 90 days #7439

BobJWalker opened this issue Mar 18, 2022 · 4 comments
Labels
category/deployments feature/retention kind/bug This issue represents a verified problem we are committed to solving p3 state/backlog On the backlog (2/4)

Comments

@BobJWalker
Copy link

Team

  • I've assigned a team label to this issue

Severity

Reported by a user on community slack

Version

2022.2 build 244 (customer verified it was happening on their instance as well)

Latest Version

I could reproduce the problem in the latest build

What happened?

I have two steps in my runbook that download and extract a package.

image

I have set my retention policies on that runbook to 2 runs per environment.

image

I run the runbook multiple times. I then manually trigger the retention policy process. Runbook runs are cleaned up as expected.

image

However, the installed packages location is not getting cleaned up. This is because that policy is hardcoded to 90 days. It is not respecting the retention policy value we set in the runbook settings.

image

Reproduction

See above.

Error and Stacktrace

|   == Success: Apply retention policy on Tentacles ==
16:12:28   Info     |     Apply retention policies...
16:12:31   Verbose  |     Apply Tentacle Retention Policy completed
                    |   
                    |     == Success: dev-server-01 ==
                    |     
                    |       Success: Applying retention policy using 90 Days to set Environments-1/Projects-582/Step-Deploy a Package/Machines-1/<default>
16:12:28   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-96977
16:12:28   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:12:28   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:12:28   Verbose  |         No user context provided. Running as current user.
16:12:29   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Work\20220318211228-96977-499' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
16:12:29   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220318211228-96977-499 exited with code 0
16:12:29   Verbose  |         Using Calamari.win-x64 21.1.2
16:12:29   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-96977
16:12:29   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:12:29   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:12:29   Verbose  |         No user context provided. Running as current user.
16:12:29   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Work\20220318211229-96977-500' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
16:12:29   Verbose  |         Calamari Version: 21.1.2
16:12:29   Verbose  |         Environment Information:
16:12:29   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.19044.0
16:12:29   Verbose  |         OsBitVersion: x64
16:12:29   Verbose  |         Is64BitProcess: True
16:12:29   Verbose  |         CurrentUser: NT AUTHORITY\SYSTEM
16:12:29   Verbose  |         MachineName: DEMOVM
16:12:29   Verbose  |         ProcessorCount: 4
16:12:29   Verbose  |         CurrentDirectory: C:\Octopus\Work\20220318211229-96977-500
16:12:29   Verbose  |         TempDirectory: C:\Windows\TEMP\
16:12:29   Verbose  |         HostProcess: Calamari (6332)
16:12:29   Info     |         Keeping deployments from the last 90 days
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_6 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_7 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_8 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_9 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_10 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_11 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_12 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Verbose  |         Keeping C:\Octopus\Applications\Development\hello-world\1.0.4_13 and C:\Octopus\Files\hello-world@S1.0.4@533FA2852AEEAD46A6BCA7557857795A.zip as it was installed 0 days and 0 hours ago
16:12:29   Info     |         Did not find any deployments to clean up
16:12:29   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220318211229-96977-500 exited with code 0
16:12:29   Verbose  |         Exit code: 0
                    |       
                    |       Success: Applying retention policy using 90 Days to set Environments-1/Projects-582/Step-Run a Script/Machines-1/<default>
16:12:30   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-96977
16:12:30   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:12:30   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:12:30   Verbose  |         No user context provided. Running as current user.
16:12:30   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Work\20220318211229-96977-501' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
16:12:30   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220318211229-96977-501 exited with code 0
16:12:30   Verbose  |         Using Calamari.win-x64 21.1.2
16:12:30   Verbose  |         Acquiring isolation mutex RunningScript with NoIsolation in ServerTasks-96977
16:12:30   Verbose  |         Executable directory is C:\Windows\system32\WindowsPowershell\v1.0
16:12:30   Verbose  |         Executable name or full path: C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe
16:12:30   Verbose  |         No user context provided. Running as current user.
16:12:30   Verbose  |         Starting C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory 'C:\Octopus\Work\20220318211230-96977-502' using 'OEM United States' encoding running as 'NT AUTHORITY\SYSTEM' with the same environment variables as the launching process
16:12:30   Verbose  |         Calamari Version: 21.1.2
16:12:30   Verbose  |         Environment Information:
16:12:30   Verbose  |         OperatingSystem: Microsoft Windows NT 10.0.19044.0
16:12:30   Verbose  |         OsBitVersion: x64
16:12:30   Verbose  |         Is64BitProcess: True
16:12:30   Verbose  |         CurrentUser: NT AUTHORITY\SYSTEM
16:12:30   Verbose  |         MachineName: DEMOVM
16:12:30   Verbose  |         ProcessorCount: 4
16:12:30   Verbose  |         CurrentDirectory: C:\Octopus\Work\20220318211230-96977-502
16:12:30   Verbose  |         TempDirectory: C:\Windows\TEMP\
16:12:31   Verbose  |         HostProcess: Calamari (7564)
16:12:31   Info     |         Keeping deployments from the last 90 days
16:12:31   Verbose  |         Keeping C:\Octopus\Files\OctoFX.Database@S2021.9.9.1@0EF6F0EF4EEA5643B1BB5CE9C9B9DB63.nupkg as it was installed 0 days and 0 hours ago
16:12:31   Verbose  |         Keeping C:\Octopus\Files\OctoFX.Database@S2021.9.9.1@0EF6F0EF4EEA5643B1BB5CE9C9B9DB63.nupkg as it was installed 0 days and 0 hours ago
16:12:31   Verbose  |         Keeping C:\Octopus\Files\OctoFX.Database@S2021.9.9.1@0EF6F0EF4EEA5643B1BB5CE9C9B9DB63.nupkg as it was installed 0 days and 0 hours ago
16:12:31   Verbose  |         Keeping C:\Octopus\Files\OctoFX.Database@S2021.9.9.1@0EF6F0EF4EEA5643B1BB5CE9C9B9DB63.nupkg as it was installed 0 days and 0 hours ago
16:12:31   Info     |         Did not find any deployments to clean up
16:12:31   Verbose  |         Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20220318211230-96977-502 exited with code 0
16:12:31   Verbose  |         Exit code: 0


### More Information

_No response_

### Workaround

Run a script in the deployment process to clean up that "install location" on each runbook run.
@BobJWalker BobJWalker added kind/bug This issue represents a verified problem we are committed to solving state/triage labels Mar 18, 2022
@zentron zentron added the p3 label Mar 21, 2022
@cstrzadala cstrzadala added state/backlog On the backlog (2/4) and removed state/triage labels Mar 28, 2022
@veochen-octopus veochen-octopus self-assigned this Apr 10, 2022
@veochen-octopus
Copy link

veochen-octopus commented Apr 11, 2022

I can see the 90 days being hardcoded for runbooks. But I don't think runbook retention policy affects tentacles. This is about how many runbook runs to keep. Tentacle retention policy is set in the lifecycle settings. Deployments already correctly use that configuration. All we need to do is making runbooks consistent.

Edit: Runbooks don't have lifecycle or release information. So there's a gap to fill here. Putting it back for some R&D work to be done first.

@Clare-Octopus
Copy link

Another report where this issue is affecting the runbooks on a customers instance as each runbook is performing retention on 17800 files as they are not being cleaned up as per the lifecycle policy (internal ticket) - https://octopus.zendesk.com/agent/tickets/131092

@Clare-Octopus
Copy link

@tothegills
Copy link
Contributor

tothegills commented Aug 31, 2023

An issue has been addressed to reduce the deployment journal size: #8310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/deployments feature/retention kind/bug This issue represents a verified problem we are committed to solving p3 state/backlog On the backlog (2/4)
Projects
None yet
Development

No branches or pull requests

8 participants