Error: Dependency cycle after upgrading to 2.14.0

Hi,

my icinga2 crashed after uprading to version 2.14.0 at my ubuntu vm. I get the error:

[2023-07-13 09:08:42 +0200] critical/config: Error: Dependency cycle:
Host 'TE-Kamera-WS.linz.liferadio.at'
-> Dependency 'TE-Kamera-WS.linz.test.at!Host to Host'
-> Host 'TE-Kamera-WS.linz.test.at'

I don´t know what this means. I haven´t changed any config before upgrading and icinga was running perfectly. This host was created by icinga2 director.

Has anyone a hint, what this means and how to solve it?

Hii, this indicates that your two hosts are depending on each other. Meaning, your host TE-Kamera-WS.linz.liferadio.at depends on TE-Kamera-WS.linz.test.at, which in turn depends on TE-Kamera-WS.linz.liferadio.at. This is a dependency cycle.

[2023-07-13 17:09:39 +0000] critical/config: Error: Dependency cycle:
Host 'DNS-server'
-> Dependency 'DNS-server!router' (this dependency contains "DSL-router" as parent host name)
-> Host 'DSL-router'
-> Dependency 'DSL-router!internet' (and this dependency contains "DNS-server" as parent host name)
-> Host 'DNS-server'

Icinga 2 2.14 detects such situations now automatically and stops config loading immediately.

Thanks, can you please tell me how I can find out where this dependency is set? I´ve already checked the /var/lib/icinga2/director folders but I can´t see this kind of dependency. I am using the director. Should I simply delete this entry? What is the best way to fix it?

This is the host object:

object Host "TE-Kamera-WS.linz.xy.at" {
    import "windows-template"

    display_name = "TE-Kamera-WS.linz.xy.at"
    address = "10.0.0.1"
    groups = [ "windows-server" ]
    vars.nscp_api_password = "xy"
}

This is dependency_apply:

apply Dependency "Host to Host" to Host {
    import "host-dependency"

    assign where "host-vm" in host.groups
    states = [ Down, Up ]
}

This host is not affected by this problem since it doesn’t define host-vm in its groups attribute.

Assuming this is the only dependency you have, then you either need to remove the host-vm group from one of the two hosts, or manually define the parent_host_name attribute in the dependency apply rule. You may also change your assign where condition to something else that matches only either host.

Yes, I´ve deleted host-vm, but how do I reload the director when the process is broken? The host had defined host-vm prior. I can´t deploy any changes till now because the process is broken.
I´ve commented out the depedency and host group and deleted it from the host, but the errors persists.

Oh, that’s unfortunate. Then you have to edit the file and start Icinga 2 manually.

I´ve edited the files - how can I start icinga2 manually? Also the dpkg upgrade didn´t run fully because it can´t write the configurations of the packages. It seems that the manual config file changes of the director are not recognized anyhow.

If you are using systemd, you can simply run this command. systemctl start icinga2, though you may run icinga2 daemon -C first to see if all configurations are loaded correctly.

Thanks, no the validition failes although I´ve edited the director configs manually and also I can´t start via systemd. I´ve tried to remove and reinstall icinga which also fails. Could this files be stored at another location then /var/lib/icinga2/api/zones/TE-Icinga-VM.linz.xy.at/director/hosts.conf?

Why remove it?

Maybe, I can’t tell your for sure. You can also grep for the host group or name. grep -R host-vm /var/lib/icinga2/api

Thanks, with grep I found two deployment folders, where this configs where stored: /var/lib/icinga2/api/packages/director/0f10e8cf-48df-44b0-8455-9a98967b138c/zones.d now the upgrade worked and Icinga2 is running again