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

Installation stuck at "Loading Powershell Framework" #781

Open
benhartwich opened this issue Feb 3, 2025 · 6 comments
Open

Installation stuck at "Loading Powershell Framework" #781

benhartwich opened this issue Feb 3, 2025 · 6 comments
Assignees
Labels
Investigation The team is looking into the cause of the issue

Comments

@benhartwich
Copy link

Hi,

I am using an elevated powershell and set:
Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process

and tried to install the power shell framework:

[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11';
$ProgressPreference                         = 'SilentlyContinue';
[string]$ScriptFile                         = 'C:\Users\Public\IcingaForWindows.ps1';

Invoke-WebRequest `
    -UseBasicParsing `
    -Uri             'https://packages.icinga.com/IcingaForWindows/IcingaForWindows.ps1' `
    -OutFile         $ScriptFile;

& $ScriptFile `
    -ModuleDirectory  'C:\Program Files\WindowsPowerShell\Modules\' `
    -InstallCommand   '{"IfW-DirectorSelfServiceKey":{"Values":["313483a65a4"]},"IfW-DirectorUrl":{"Values":["http://te-icinga-vm.xy.at/director/"]},"IfW-StableRepository":{"Values":["https://packages.icinga.com/IcingaForWindows/stable"]}}' `
    -IcingaRepository 'https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json'

The installation is stuck at "loading powershell framework - what could I´ve done wrong?

[Notice]: PowerShell Execution-Policies are configured to run Scripts and/or Modules.
[Notice]: Icinga PowerShell Framework is already installed. Using Framework functions for kickstarter.
[Notice]: Loading Icinga PowerShell Framework.
@LordHepipud
Copy link
Collaborator

The system shouldn't freeze at this point and can't reproduce this. What operating system are you running this on?
Have you set the execution policy for the CurrentUser / LocalMachine as well?

@LordHepipud LordHepipud added the Investigation The team is looking into the cause of the issue label Feb 3, 2025
@LordHepipud LordHepipud self-assigned this Feb 3, 2025
@benhartwich
Copy link
Author

I have set the ExecutionPolicy to CurrentUser and there it stops at another when trying a new install on Windows 11 Pro.

[Notice]: The task "Set Process Priority" has been successfully registered at location "\Icinga\Icinga for Windows\".

I don´t know where to start - is there any kind of debug parameter for the script in order to see, what is happening exactly?

@LordHepipud
Copy link
Collaborator

What happens if you run

icinga -Shell

Basically what is called next after the message is

Use-Icinga

Maybe we can start there to check what is going on.

@benhartwich
Copy link
Author

It succeeded after setting the ExecutionPolicy to ByPass for the LocalMachine also and reinstalled all.

@f1ngerscr0ssed
Copy link

f1ngerscr0ssed commented Feb 19, 2025

We are seeing the same problem, changing the execution policy does not make it different.

In WS2016, Use-Icinga and -Shell get stuck.

It seems the framework installation gets stuck at

[Notice]: Applying pending migrations required for Icinga for Windows v1.13.0.1
[Notice]: The task "Set Process Priority" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Error]: The scheduled task "Management Task" at path "\Icinga\Icinga for Windows\" could not be executed within 180 seconds and run into a timeout

Seems the below that gets stuck

powershell -WindowStyle Hidden -Command &{ & 'C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\jobs\GetWindowsService.ps1' -ServiceName 'icinga2' -TmpFilePath 'C:\Users\username\AppData\Local\Temp\2\tmp_icinga319485347.tmp' }

We have tried rebooting this machine, or uninstalling the framework module but does not seem to work.

@f1ngerscr0ssed
Copy link

f1ngerscr0ssed commented Feb 19, 2025

I found the root cause, underneath GetWindowsService.ps1 it will call Get-IcingaWindowsInformation.ps1 that will be used to query services (to find icinga2), in our case we had a log shipper "filebeat" that seem to make the ultimate underneath query Get-CimInstance Win32_Service super slow (or not able to return in many cases), this was hanging the execution of the scheduled task and GetWindowsService.ps1 was never finishing.

Underneath all this, the ultimate basic call that was hanging in one of the scripts above was Get-CimInstance Win32_Service

After killing the filebeat process, we were able to install the framework and the agent correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigation The team is looking into the cause of the issue
Projects
None yet
Development

No branches or pull requests

3 participants