Icinga2 Agent Installation Fails with JSON Conversion Error When Using PowerShell Framework Versions Above 1.11.1 (Latest: 1.13.0)

We have set up our own internal repositories following a directory hierarchy similar to:

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

Our repository stores different versions of Icinga components, and we have a custom script to install the Icinga2 agent. Recently, while attempting to upgrade the agent, we encountered the following error:

[Error]: Failed to convert retrieved content from repository "Icinga Stable" with location "http://****/Software/Icinga2/Windows/Installer/IcingaForWindows/stable" to JSON

This issue arises when updating ifw.repo.json to pick up the latest Icinga PowerShell Framework version (e.g., 1.13.0 or higher). The installation works fine with version 1.11.1, but any attempt to use a newer version results in the above JSON conversion error, regardless of how many times we try.

Workaround Attempted:

  • I manually downloaded the Icinga PowerShell Framework 1.13.0 via PowerShell and replaced the existing 1.11.1 installation.
  • Interestingly, this worked as expected because the plugin version (icinga-powershell-plugins-1.13.0.zip) is available in the repository.
  • However, the script still fails to download and install the framework automatically during agent installation.

Background:

We have created our own internal repositories for Icinga2 and structured them similarly to the official Icinga repository:

:link: Example Directory Hierarchy:

http://<internal-repo>/Software/Icinga2/Windows/Installer/IcingaForWindows/stable/

This repository stores multiple versions of Icinga components, allowing us to manage different versions of the agent and framework.

We have also developed a custom PowerShell script to install the Icinga2 Agent from our internal repository.

Issue Encountered:

Recently, we attempted to upgrade the Icinga2 Agent by modifying our ifw.repo.json file to use the latest Icinga PowerShell Framework version 1.13.0 instead of 1.11.1.

:point_right: Previous Working Entry (1.11.1):

{
    "Hash": "EXAMPLE_HASH",
    "Location": "framework/icinga-powershell-framework-1.11.1.zip",
    "RelativePath": true,
    "Version": "1.11.1",
    "Snapshot": false,
    "Architecture": "Multi"
}

When using version 1.11.1, the installation works perfectly.

:point_right: Updated Entry for 1.13.0 (Causing Issues):

{
    "Hash": "0770E311C418D98536F81422F7C2E10A43D8BE211D169D36E6C5351D13CA98C4",
    "Location": "framework/icinga-powershell-framework-1.13.0.zip",
    "RelativePath": true,
    "Version": "1.13.0",
    "Snapshot": false,
    "Architecture": "Multi"
}

After making this change, we repeatedly encounter the following error during installation:

Error Message:

[Error]: Failed to convert retrieved content from repository "Icinga Stable" with location "http://****/Software/Icinga2/Windows/Installer/IcingaForWindows/stable" to JSON

This error persists regardless of how many times we try to install the agent using the updated ifw.repo.json.

Troubleshooting Steps Taken:

  1. Checked JSON Formatting:
  • Validated the ifw.repo.json file to ensure it is correctly structured.
  • Confirmed that there are no trailing commas or syntax errors.
  1. Verified File Accessibility:
  • Confirmed that icinga-powershell-framework-1.13.0.zip is accessible from the repository URL.
  • Downloaded the file manually to verify it exists and is not corrupted.
  1. Compared with Working Version (1.11.1):
  • No changes in repository structure or installation script.
  • Only difference is the updated version in ifw.repo.json.
  1. Attempted to Reinstall Multiple Times:
  • No success. The same error occurs every time.

  • Why does Icinga fail to parse the repository JSON when switching to version 1.13.0?

  • Are there known issues with the Icinga PowerShell Framework 1.13.0 in internal repositories?

  • Does Icinga validate the hash or file differently for newer versions?

  • Is there a way to debug why the repository conversion fails?

Any insights or suggestions would be greatly appreciated!

Has anyone encountered this issue or something similar? Can anyone please assist me with this?

Are there any more details present on the error message? This message should only occur in case the JSON file being downloaded is corrupt, incomplete or wrongly formatted.

What happens if you load the json file and run the following code:

$JsonString = Get-Content -Path '<your json>' -Raw -Encoding UTF8;

Test-IcingaJSONObject -InputObject $JsonString;

If this fails, can you please try with

$JsonObj = ConvertFrom-Json -InputObject $JsonString;

I have followed the steps you suggested and tested the JSON file. Here are the results:

Commands Executed & Results

. Loaded JSON File:**

$JsonString = Get-Content -Path "C:\temp\ifw.repo.json" -Raw -Encoding UTF8

Successfully loaded the JSON file without any errors.

. Tested JSON with Test-IcingaJSONObject:**

Test-IcingaJSONObject -InputObject $JsonString

Command executed, but still getting the same error.
Converted JSON to Object for Verification:**
t

$JsonObj = ConvertFrom-Json -InputObject $JsonString

JSON parsed successfully without any errors.

Checked JSON Structure for Any Issues:**

$JsonObj | Format-List

The JSON structure appears correct and contains expected key-value pairs.

Manually Downloaded JSON to Check for Corruption:**

Invoke-WebRequest -Uri "http://<MyRepo>/Software/Icinga2/Windows/Installer/IcingaForWindows/stable/ifw.repo.json" -OutFile "C:\temp\ifw.repo.json"

File downloaded successfully. Opened in Notepad++/VS Code, and the formatting looks fine.

Issue Still Persists

Despite the JSON file being correctly formatted and successfully parsed using ConvertFrom-Json, I am still getting the same error message when running the installation.

I’m cluseless here what could be cause and how it can be solved

Would appreciate any further guidance!

I just wanted to share that we also do experience this error message in our environment during IfW installation. Is it actually related to my report ? IcingaForWindows - IcingaPowerShell framework - 'The component "agent" was not found on stable channel with version "2.14.2" '

Can you by any chance share the JSON file?

I don’t see any issue on why the JSON-Conversion is working with the native function, but the Icinga test fails.

I’m not doing anything different in this case.