Skip to content

ThresholdInterval throws StackOverflowException. Crashes service when API Check Forwarder is enabled. #873

@bewshy

Description

@bewshy

Problem:

-ThresholdInterval with no collected metrics throws StackOverflowException (crashes the service when API Check Forwarder is enabled)

Expected Behavior:

Running a plugin with -ThresholdInterval set to an interval for which no metrics have been collected should return a graceful check result.

Current Behavior

When -ThresholdInterval is used on a host where no background service checks are registered (so no metrics-over-time data exists for any interval), the check does not return an error. Instead the process aborts with:

Process is terminated due to StackOverflowException.

Because a StackOverflowException is uncatchable in .NET/PowerShell, the entire process is torn down. When the REST API daemon and API Check Forwarder is in use, the entire Icinga Powershell service is killed.

Steps to Reproduce

  1. Install the Icinga for Windows PowerShell service and register the metrics daemon, but register no service checks. Confirm with:
    Show-IcingaRegisteredServiceChecks
    # => No background service checks configured
    Show-IcingaRegisteredBackgroundDaemons
    # => Start-IcingaServiceCheckDaemon
    # => Start-IcingaWindowsRESTApi
  2. Run a plugin with -ThresholdInterval set to any interval from the Icinga shell:
    icinga { Invoke-IcingaCheckCPU -Warning 80 -Critical 90 -ThresholdInterval 15m }
  3. Observe the process terminate with Process is terminated due to StackOverflowException.
    instead of a graceful result.
  4. With the API Check Forwarder enabled, triggering the same check through forwarded
    execution crashes the entire Icinga for Windows PowerShell service.

Environment

  • Icinga for Windows / framework version: 1.14.2
  • Plugins version: 1.14.1
  • PowerShell version 5.1.17763.8755
  • Icinga 2 Agent version: 2.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions