Failed to remove Icinga Agent: Trying to upgrade or uninstall the agent

Before you ask a question, you can check the troubleshooting documentation first, maybe you can find an answer here.

Please describe your problem as detailed as possible and don’t forget to use a meaningful title There
We also have a markdown formatting guide to help you make your topics more readable!

Give as much information as you can, e.g.

  • Version used (icinga2 --version)
    2.13.8 → 2.13.1 down grading to meet requirements of master2 and satellites running.

  • Operating System and version
    Windows Server 2019

  • Enabled features (icinga2 feature list)
    Enabled features: checker notification windowseventlog

  • Icinga Web 2 version and modules (System - About)
    Icinga Web 2 Version 2.11.4 running on a seperate server (Oracle Linux)

  • Config validation (icinga2 daemon -C)
    C:\Program Files (x86)\ICINGA2\sbin> .\icinga2.exe daemon -C
    [2023-11-07 14:56:32 -0000] information/cli: Icinga application loader (version: v2.13.8)
    [2023-11-07 14:56:32 -0000] information/cli: Loading configuration file(s).
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Committing config item(s).
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Instantiated 244 CheckCommands.
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Instantiated 1 WindowsEventLogLogger.
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Instantiated 1 NotificationComponent.
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Instantiated 1 CheckerComponent.
    [2023-11-07 14:56:33 -0000] information/ConfigItem: Instantiated 1 IcingaApplication.
    [2023-11-07 14:56:33 -0000] information/ScriptGlobal: Dumping variables to file ‘C:\ProgramData\icinga2\var\cache\icinga2/icinga2.vars’
    [2023-11-07 14:56:33 -0000] information/cli: Finished validating the configuration file(s).

  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes

Zones.conf file is empty on agent server. This maybe due to the removal that I tried.

I have tried to uninstall
C:\Users\admin-mb> Uninstall-IcingaAgent -RemoveDataFolder;
[Notice]: Stopping service “icinga2”
[Error]: Failed to remove Icinga Agent:
False
C:\Users\admin-mb> Uninstall-IcingaAgent;
[Notice]: Stopping service “icinga2”
[Error]: Failed to remove Icinga Agent:
False
C:\Users\admin-mb> Install-IcingaAgent -Version ‘2.14.0’
[Notice]: Downloading Icinga 2 Agent installer “Icinga2-v2.14.0-x86_64.msi” into temp directory “C:\Users\admin-mb\AppData\Local\Temp\Icinga2-v2.14.0-x86_64.msi”
[Notice]: Installing new Icinga Agent version into "C:\Program Files (x86)\ICINGA2"
[Notice]: Stopping service “icinga2”
[Error]: Failed to remove Icinga Agent:
False

I seem to be stuck in a state where Icinga2 cannot get past the removal of the existing 2.13.8 Icinga2 Agent.

In my configuration of a few Windows Agent i have successfully downgraded them, Only this server has this issue. Is there a lock file that maybe stopping the unistall or update?

I had a similar problem and fixed it by moving the icinga folders (install and data) into the trash.
Afterwards the installation worked.

Hi Dominik, I have tried this and I am still getting the same error.
I renamed the folder with icinga2 not started.
I ran
icinga> Install-IcingaAgent -Version ‘2.13.1’
[Notice]: Downloading Icinga 2 Agent installer “Icinga2-v2.13.1-x86_64.msi” into temp directory “C:\Users\admin-mb\AppData\Local\Temp\Icinga2-v2.13.1-x86_64.msi”
[Notice]: Installing new Icinga Agent version into "C:\Program Files (x86)\ICINGA2"
[Notice]: Stopping service “icinga2”
[Error]: Failed to remove Icinga Agent:
False
I also tried to manually run the install and it also failed.
I tried 2.14.0 as well and this did not work either.
icinga> Install-IcingaAgent -Version ‘2.14.0’
[Notice]: Downloading Icinga 2 Agent installer “Icinga2-v2.14.0-x86_64.msi” into temp directory “C:\Users\admin-mb\AppData\Local\Temp\Icinga2-v2.14.0-x86_64.msi”
[Notice]: Installing new Icinga Agent version into "C:\Program Files (x86)\ICINGA2"
[Notice]: Stopping service “icinga2”
[Error]: Failed to remove Icinga Agent:
False
image

Did you also delete / move the C:\ProgramData\icinga2\ folder?

Yes I moved it to old_icinga2

I guess, now a msi guru is needed as I’m no Windows expert.
Removing the folders and the keys in the registry should allow a new installation I guess.
I wouldn’t mess with the registry without a backup / snapshot of the machine.

We have snapshots of this machine. Are there any MSI guru’s on here?