Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icinga PowerShell Framework v1.13.0 - Test-IcingaForWindowsService - Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero. #778

Closed
Aleksey-Maksimov opened this issue Jan 31, 2025 · 3 comments · Fixed by #779
Assignees
Labels
Bug There is an issue present
Milestone

Comments

@Aleksey-Maksimov
Copy link

Hello

After updating Icinga PowerShell Framework to v1.13.0, the Test-IcingaForWindowsService cmdlet stopped working

PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework> Test-IcingaForWindowsService
Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero.
Parameter name: length"
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:4260 char:5
+     [string]$ServicePath = $ServiceConfig.ServicePath.SubString(0, $S ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentOutOfRangeException

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:4262 char:9
+     if ($ServicePath.Contains('"')) {
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

[Passed]: Your service installation is properly referring to "icinga-powershell-framework.psd1" for module imports.
True

Icinga for Windows environment overview:

PowerShell Root => C:\Program Files\WindowsPowerShell\Modules
Icinga for Windows Service Path => C:\Program Files\icinga-framework-service
Icinga for Windows Service User => NT Authority\NetworkService
Icinga for Windows Service Pid => 8392
Icinga for Windows JEA Pid =>
Icinga Agent Path => C:\Program Files\ICINGA2
Icinga Agent User => NT Authority\NetworkService
Defined Default User =>
Icinga Managed User => False
PowerShell Version => 5.1.20348.2849
Operating System => Microsoft Windows Server 2022 Standard
Operating System Version => 10.0.20348
JEA Context =>
JEA Session File =>
Api Check Forwarder => True
Debug Mode => False

Icinga for Windows Certificate:

Issuer => CN=Icinga CA
Subject => CN=dev05.holding.com

List of configured background daemons on this system:

Start-IcingaWindowsRESTApi

No arguments defined

List of configured background service checks on this system:
=> https://icinga.com/docs/icinga-for-windows/latest/doc/110-Installation/06-Collect-Metrics-over-Time/

No background service checks configured

List of configured repositories on this system. The list order matches the apply order:

No repositories configured
Installed components on this system:

Component Version
agent 2.14.2
framework 1.13.0
plugins 1.13.0

@LordHepipud LordHepipud self-assigned this Jan 31, 2025
@LordHepipud LordHepipud added the Bug There is an issue present label Jan 31, 2025
@LordHepipud LordHepipud added this to the v1.13.1 milestone Jan 31, 2025
@LordHepipud
Copy link
Collaborator

Seems this was introduced by #751

@Aleksey-Maksimov
Copy link
Author

Thank you. We will wait for a new release with this fix.

@LordHepipud
Copy link
Collaborator

The new Icinga for Windows package 1.13.1 should be available shortly on packages.icinga.com. I just created a new release to address this issue.

Sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug There is an issue present
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants