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 with self service API not working anymore #718

Closed
tomabg opened this issue Apr 10, 2024 · 6 comments · Fixed by #720
Closed

installation with self service API not working anymore #718

tomabg opened this issue Apr 10, 2024 · 6 comments · Fixed by #720
Assignees
Labels
Bug There is an issue present
Milestone

Comments

@tomabg
Copy link

tomabg commented Apr 10, 2024

last week all was working perfect

seems it has problems with converting https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json


[Notice]: Starting Icinga for Windows installation
[Notice]: Remote repository "Icinga Stable" was successfully added
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18070 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "agent" was not found on stable channel with version "2.14.2"
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18070 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "service" was not found on stable channel with version "release"
[Notice]: Background daemon Cmdlet "Start-IcingaServiceCheckDaemon" has been configured
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18070 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "plugins" was not found on stable channel with version "release"
The Icinga Agent seems not to be installed
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:4833 Zeichen:9
+         throw 'The Icinga Agent seems not to be installed';
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (The Icinga Agen...to be installed:String) [], RuntimeException
    + FullyQualifiedErrorId : The Icinga Agent seems not to be installed

PS C:\windows\system32>
@tomabg
Copy link
Author

tomabg commented Apr 10, 2024

PS C:\windows\system32> Get-IcingaRepositories


MemberType      : NoteProperty
IsSettable      : True
IsGettable      : True
Value           : @{LocalPath=; RemotePath=https://packages.icinga.com/IcingaForWindows/stable; CloneSource=;
                  UseSCP=False; Order=0; Enabled=True}
TypeNameOfValue : System.Management.Automation.PSCustomObject
Name            : Icinga Stable
IsInstance      : True



PS C:\windows\system32> Read-IcingaRepositoryFile -Name "Icinga Stable"
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18070 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

PS C:\windows\system32>

@tomabg
Copy link
Author

tomabg commented Apr 10, 2024

after adding Parameter it is working..so problem is inside the latest 1.12.1 release

-IcingaRepository 'https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json' `
-FrameworkVersion "1.12.0"

@tectumopticum
Copy link

confirmed:
`PS C:\Windows\system32> Read-IcingaRepositoryFile -Name "Icinga Stable"
ConvertFrom-Json : Invalid JSON primitive: .
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18070 char:29

  • ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    • FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand`

@LordHepipud
Copy link
Collaborator

Thanks for the issue.

Are you using the following path anywhere on your automation scripts for web requests (not local or network file shares)?

https://packages.icinga.com/IcingaForWindows/stable

In case you do, can you please try to set it to

https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json

This should resolve the issue for now. I already found the bug, but as I just released 1.12.2 (saw this issue too late), I would add it to v1.12.3 but wait a little longer to check, if there are more issues coming through.

@LordHepipud LordHepipud added the Bug There is an issue present label Apr 10, 2024
@LordHepipud LordHepipud self-assigned this Apr 10, 2024
@LordHepipud LordHepipud added this to the v1.12.3 milestone Apr 10, 2024
@tomabg
Copy link
Author

tomabg commented Apr 11, 2024

retest with 1.12.2 failed.

Please release 1.12.3 as soon as possible.

used command was copied from Icinga director Agent Secsion:

& $ScriptFile `
>>     -ModuleDirectory  'C:\Program Files\WindowsPowerShell\Modules\' `
>>     -InstallCommand   '{"IfW-DirectorSelfServiceKey":{"Values":["SECRET"]},"IfW-DirectorUrl":{"Values":["https://10.216.5.6/icingaweb2/director/"]},"IfW-StableRepository":{"Values":["https://packages.icinga.com/IcingaForWindows/stable"]}}' `
>>     -IcingaRepository 'https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json'
[Notice]: Starting Icinga for Windows installation
[Notice]: Remote repository "Icinga Stable" was successfully added
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18085 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "agent" was not found on stable channel with version "2.14.2"
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18085 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "service" was not found on stable channel with version "release"
[Notice]: Background daemon Cmdlet "Start-IcingaServiceCheckDaemon" has been configured
ConvertFrom-Json : Ungültiger JSON-Primitiv: .
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:18085 Zeichen:29
+ ... oryObject = ConvertFrom-Json -InputObject $Content -ErrorAction Stop; ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

[Error]: The component "plugins" was not found on stable channel with version "release"
[Notice]: Successfully removed Icinga firewall rule
The Icinga Agent seems not to be installed
In C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:4848 Zeichen:9
+         throw 'The Icinga Agent seems not to be installed';
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (The Icinga Agen...to be installed:String) [], RuntimeException
    + FullyQualifiedErrorId : The Icinga Agent seems not to be installed

PS C:\windows\system32>

@LordHepipud
Copy link
Collaborator

LordHepipud commented Apr 12, 2024

You can use a workaround for this for the moment by modifying the Icinga Director script as follows:

& $ScriptFile `
    -ModuleDirectory  'C:\Program Files\WindowsPowerShell\Modules\' `
    -InstallCommand   '{"IfW-DirectorSelfServiceKey":{"Values":["SECRET"]},"IfW-DirectorUrl":{"Values":["https://10.216.5.6/icingaweb2/director/"]},"IfW-StableRepository":{"Values":["https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json"]}}' `
    -IcingaRepository 'https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json'

The

"IfW-StableRepository":{"Values":["https://packages.icinga.com/IcingaForWindows/stable"]}

is missing the /ifw.repo.json, which is why it fails at the moment with v1.12.1.

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.

3 participants