Product: Powershell Universal
Version: 1.5.14
Issue Reported at: Set-PSUCache ResourceExhausted when setting large data · Issue #74 · ironmansoftware/issues · GitHub
Describe the bug
When setting the value of a PSUCache entry to a value larger than 4MB(?).
To Reproduce
Steps to reproduce the behavior:
- In a UA script, Create a
$variable
storing greater than 4MB of data. - Follow this with
Set-PSUCache -Key AnyName -Value $variable
$Variable = #Some 4MB or larger dataset
Set-PSUCache -Key Any -Value $Variable
Expected behavior
Successful storage of dataset in PSUCache entry
Version
Version Number: 1.5.14
Operating System:
Microsoft Windows Server 2019 Datacenter
10.0.17763 Build 17763
Additional context
I had run a process to collect system information from ~50 hosts. This included the output from:
{
$Features = Get-WindowsFeature | Select-Object -Property DisplayName, InstallState -ErrorAction SilentlyContinue
$OptionalFeatures = Get-WindowsOptionalFeature -Online | Select-Object -Property FeatureName, State | Sort-Object FeatureName -ErrorAction SilentlyContinue
$WmiSoftware = Get-CimInstance -Class CIM_Product | Select-Object -Property Name, Vendor, Version, Caption -ErrorAction SilentlyContinue
$ComputerInfo = Get-ComputerInfo -ErrorAction SilentlyContinue
[PSCustomObject]@{
Features = $Features
OptionalFeatures = $OptionalFeatures
WmiSoftware = $WmiSoftware
ComputerInfo = $ComputerInfo
}
}
I assume this is converted to serialized data using the PSSerializer, however, I have not yet tested pre-compressing the data.
Logs
PS>TerminatingError(Set-PSUCache): "Status(StatusCode=ResourceExhausted, Detail="Received message larger than max (17130338 vs. 4194304)")"
Set-PSUCache: C:\PathTo\MyScript.ps1:182
Line |
182 | Set-PSUCache -Key PsuCacheKey -Value $SomeValue
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Status(StatusCode=ResourceExhausted, Detail="Received message larger than max (17130338 vs. 4194304)")
None of the logs have any additional info at that time. I checked all the logs (which are set to log at the Debug level) including Event Logs, and there is nothing of note at the time the error occurred. just:
2021-03-18T18:17:23.0337284-05:00 [DBG] Job 119919 status Failed. (544534e5)
2021-03-18T18:17:23.0337497-05:00 [DBG] Job 119919 error . (534902b2)
2021-03-18T18:17:24.0908395-05:00 [INF] Job 119919 completed (551badf3)