Skip to content

[Bug]:ResponsePayloadTooLarge #377

@juanandmsft

Description

@juanandmsft

Describe the bug
When running with -SecurityCenter an error is thrown about ResponsePayloadTooLarge.
The script Invoke-ARIInventoryLoop.ps1 contains logic to attempt to extract first 1000 objects and then retry with 200 if fails, but never enters in the catch to retry.

I was able to fix it by adding $ErrorActionPreference = "Stop" inside Invoke-ARIInventoryLoop function, and changing retry from 200 to 100.
Also made more prevalent in catch blocks debug messages that it is retrying.

To Reproduce
How can we reproduce this error? What were your input parameters?

Expected behavior
Properly retry when ResponsePayloadTooLarge error is thrown.

Screenshots

Error:
Image

With fix:

Image

Environment
Windows 11, PowerShell 7.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions