Hi @Tom-Elliott ,
I switched our FOG server to dev-branch and started testing the new WinGet cache.
Test environment:
FOG Server 1.6.1.349 (dev-branch) FOG Agent 0.1.39 Ubuntu 22.04.5 LTS 93 Windows 11 computers assigned to the 7-Zip software package 165 GB of free disk spaceThe upgrade completed successfully. All 12 FOG services are running, the required PHP extensions are installed, and the cache directories were created correctly.
Issue: Cached installers are immediately removed
I enabled caching for 7-Zip (Latest, Present, default source, architecture x64).
All six installer variants of version 26.06 were downloaded successfully. However, the service immediately removed all six installers and the generated manifest.
The final log entry was:
Software cache: 6 downloaded, 0 failed, 7 removed
The cache directories and the softwareCache database table are empty afterwards. The General tab also does not display any cache state information.
I reproduced this behaviour multiple times.
Possible root cause
After investigating src/Agent/SoftwareCache.php, I noticed that _record() uses the named PDO parameter :now twice in the INSERT statement:
:sha,:path,:state,:msg,:now,:now
However, src/Db/PDODB.php explicitly disables prepared statement emulation:
\PDO::ATTR_EMULATE_PREPARES => false
I verified this behaviour with two read-only PHP/PDO queries directly on the FOG server:
SELECT :now, :now — SQLSTATE[HY093]: Invalid parameter number SELECT :now, :cachedAt — OKMy assumption is that the cache database record is not saved successfully. Consequently, _plan() finds no referenced manifests or installers, and _prune() removes all downloaded files.
Using a separate parameter such as :cachedAt might resolve the issue.
Additional findings
LibreOffice caching currently reports:
TheDocumentFoundation.LibreOffice: has package dependencies; caching is not supported for it yet
Regular WinGet software management appears to continue working.
Thank you again for your work on this feature.