Depending on Chocolatey version there are two commands that can be run to get that data.In your instructions, you said to run 'choco list -r' but I think that gets a list of all apps available in the choco repo (it listed 217 packages)...
instead, I ran 'choco list --localonly' and got this:
Pre 2.1.0 Chocolatey uses choco list --local where Post Chocolatey 2.1.0 uses "list" without the --local, "search" is now the basic "list" for getting repo items.
So this tells me that you should be using a pre 2.1.0 Chocolatey framework on this agent which is fine.
This is common and expected behavior. All packages typically creates a directory with the package name and version number. There maybe files there or not depending on package nuget file. This nuget file is typically in the root of the cache and will reference a folder and file to install. Some files are left to remote downloads so this is where the folder would be there but empty.Looking at the site I am working with now, there are no files in some of the directories on the caching server... the empty directories
Example: 7Zip nuget instructs choco to download 7zip from 7zip site directly. Chocolatey install is a simple powershell script so install.ps1 is also in root of cache and does not need a directory but one exists anyways.
If you want to verify files in cache, verify all approved apps show as a nuget file in cache folder root. If nuget file is missing the the package is not complete and would fail any install.
The cache update script function does just what you did, deletes the directories before starting any cache downloads. Because you deleted the directory first before running, when it went to delete folder, it was not there. No biggy it will move on as expected.I deleted the "packages" folders in both c:\windows\ltsvc\chocolatey -AND- in the shared folder defined in the location "script and template variables" and ran the "update repo cache" again
I do see .nupkg files in the root of the packages folder... just looks like all the packages aren't downloading.
I do see 1 failed command: "Remove Directory" Parameters "%ltsvcdir%\Chocolatey\packages" output "Error deleting directories - check local log file"
I looked at LTErrors.txt and see this...
30.347 - 8/29/2023 4:06:20 PM - Error Deleting File: C:\Windows\LTSvc\Chocolatey\packages\dropbox.181.4.5678.nupkg, The process cannot access the file 'C:\Windows\LTSvc\Chocolatey\packages\dropbox.181.4.5678.nupkg' because it is being used by another process.:::
This is error says that the file "dropbox.xxx.nuget" is still in use and can not be deleted. This could be a lot of things. It could be some file lock on this file from PC hosting files or another agent currently using file to install package. Any reason that this file would be "open" when agent tries to delete. In this case its a local file (C:\Windows\LTSvc\Chocolatey\packages\dropbox.181.4.5678.nupkg) so this error would be the local agent still has file open and the script tries to delete. So question would be , why did agent return from install or update command and then after that tried to delete file but yet it is still in use? From scripts perspective it should be dormant as script is no longer executing a install or upgrade command.
Maybe that file is stuck from a previous botched install and is being held open by OS? I would not know from logs.
Another error in the machine log:
Parameters: cmd.exe!!! /c "%ltsvcdir%\Chocolatey\ChocoCacher.exe %ltsvcdir%\Chocolatey\packages http://chocolatey.org/api/v2/package/firefox/"
Output: Downloading: Firefox.117.0.0.nupkg
Download Failed: https://download.mozilla.org/?product=f ... g=${locale}
System.Net.WebException: The remote server returned an error: (404) Not Found.
Your error is The remote server returned an error: (404) Not Found. URL was https://download.mozilla.org/?product=f ... g=${locale}
This is not a plugin issue but a nuget package and firefox issue. The download references a file or version that is not available at mozilla.org
This most likely a temporary issue, try again.
Also, the files/folders have not copied back over to the caching share at location "script and template variables" and ran the "update repo cache" -- it remains empty... where is the script supposed to check/copy/sync the packages folders?
First I would check caching agent, did it get the script scheduled? if so did it complete successfully,
The agent will copy all files locally first, then copy to cache share before deleting local copy. Did local copy show up? Did local copy get deleted?
Script log should show if an error arose.
You can sit on agent with file explorers open to local cache location and caching share while script runs to update cache. You should see both directories get deleted, files copied to local folder first (one at a time), The agent copy files to cache share and then deletes the local copy. You should be able to see this in the file explore as it happens.
If its failing, the script log should show at what step