chocolatey-licensed-issues icon indicating copy to clipboard operation
chocolatey-licensed-issues copied to clipboard

Package Reducer / choco optimize - not working in some cases

Open mmundy1 opened this issue 4 years ago • 4 comments

What You Are Seeing?

After downloading and recompiling sql-server-2017-cumulative-update, the binaries are still present even when it should be optimized. sql-server-management-studio appears to exhibit similar behavior.

What is Expected?

After sql-server-2017-cumulative-update is installed from a localized package, the .exe is still present

How Did You Get This To Happen? (Steps to Reproduce)

  1. set choco features with
  • name: Ensure Chocolatey Features

    win_chocolatey_feature: name: "{{ item.name }}" state: "{{ item.state }}" loop:

  • name: downloadCache

  state: disabled
  • name: reduceInstalledPackageSpaceUsage
  state: enabled
  • name: useFIPSCompliantChecksums
  state: enabled
  1. download and recompile package from https://chocolatey.org/packages/sql-server-2017-cumulative-update
  2. upload to local chocolatey server
  3. install via win_chocolatey
  4. see files still present in directory Directory: C:\ProgramData\chocolatey\lib\sql-server-2017-cumulative-update\tools Mode LastWriteTime Length Name

d----- 2/10/2021 6:31 PM files -a---- 2/10/2021 6:31 PM 1844 chocolateyinstall.ps1 -a---- 2/10/2021 6:31 PM 559201160 SQLServer2017-KB4577467-x64.exe -a---- 2/10/2021 6:35 PM 0 SQLServer2017-KB4577467-x64.exe.ignore

Note: running 'choco optimize' manually does not correct the issue either.

References

┆Issue is synchronized with this Gitlab issue by Unito

mmundy1 avatar Feb 11 '21 00:02 mmundy1

The installer is also present (and not reduced) in the files directory

Directory: C:\ProgramData\chocolatey\lib\sql-server-2017-cumulative-update\tools\files

Mode LastWriteTime Length Name


-a---- 2/10/2021 6:31 PM 559201160 SQLServer2017-KB4577467-x64.exe -a---- 2/10/2021 6:35 PM 0 SQLServer2017-KB4577467-x64.exe.ignore

mmundy1 avatar Feb 11 '21 01:02 mmundy1

Hi @mmundy1 - I transferred the issue over here to Chocolatey-Licensed-Issues. If you can, please run choco support and follow the instructions to create a support ticket. We may need some more information from you (logs)

ferventcoder avatar Feb 17 '21 17:02 ferventcoder

We've had another instance of this:

References

Zendesk Ticket

Reproduction Steps

On a system with several packages installed, I've confirmed content is available in the cacheLocation, both on a default system where cacheLocation is $env:TEMP, and on a system where I've configured the location explicitly with choco config set cacheLocation C:\programdata\chocolatey\choco-cache.

When I run the choco optimize command, according to the documentation I am expecting to see the cacheLocation cleared of downloaded binaries, however, this is not the case:

On a system with several packages installed, I've confirmed content is available in the cacheLocation, both on a default system where cacheLocation is $env:TEMP, and on a system where I've configured the location explicitly with choco config set cacheLocation C:\programdata\chocolatey\choco-cache. When I run the choco optimize command, according to the documentation I am expecting to see the cacheLocation cleared of downloaded binaries, however, this is not the case:

PowerShell Output (note the GoogleChrome package here):

image

Cache location after running the command

image

EDIT:

I've since rebooted this test machine, and upon checking again, this is the directory:

image

Clearly something was cleaned up here. Perhaps Optimizer marks files for deletion after next reboot?

steviecoaster avatar Feb 17 '22 16:02 steviecoaster

Please can a fix for this be investigated. This is causing our servers to run out of space when installing packages with large binaries. Thanks

chosenv3 avatar Feb 18 '22 08:02 chosenv3