Icinga: ERROR: Can't use an undefined value as a HASH reference. (thruk_host.my_network.net:6557)

  • Receiving the following error when clicking on 'Tactical Overview' or 'Performance Info' from the side menus since upgrading to icinga2-2.7.1-1.el7.icinga.x86_64 from 2.7.0 from official package. Same links worked in 2.7.0.


    Code
    1. No Backend available
    2. None of the configured Backends could be reached, please have a look at the logfile for detailed information and make sure the core is up and running.
    3. Details:
    4. Icinga: ERROR: Can't use an undefined value as a HASH reference. (thruk_host.my_network.net:6557)
  • Hi,

    I have the same problem.

    Adding more information... the "balance all hosts and services" feature in the "Core scheduling graph" now returns "0 hosts and services rescheduled successfull".


    - CentOS 7.4.1708

    - icinga2-2.7.1-1

    - thruk-2.16-2


    In thruk.log:


    Code
    1. [2017/09/25 11:02:29][XXXXXXXXXX][ERROR][Thruk] Error in: /thruk/cgi-bin/tac.cgi
    2. [2017/09/25 11:02:29][XXXXXXXXXX][ERROR][Thruk] Can't use an undefined value as a HASH reference at /usr/share/thruk/lib/Thruk/Backend/Provider/Livestatus.pm line 1229.
    3. at /usr/lib64/thruk/perl5/Plack/Util.pm line 142.
    4. eval {...} called at /usr/lib64/thruk/perl5/Plack/Util.pm line 142
    5. Plack::Util::run_app('CODE(0x2c54570)', 'HASH(0x41b3658)') called at /usr/lib64/thruk/perl5/Plack/Handler/FCGI.pm line 143
    6. Plack::Handler::FCGI::run('Plack::Handler::FCGI=HASH(0x2155c48)', 'CODE(0x2c54570)') called at /usr/share/thruk/script/thruk_fastcgi.pl line 24
    7. [2017/09/25 11:02:29][XXXXXXXXXXX][ERROR][Thruk] No Backend available
    8. [2017/09/25 11:02:29][XXXXXXXXXXX][ERROR][Thruk] on page: http://XXXXXXXX/thruk/cgi-bin/tac.cgi
    9. [2017/09/25 11:02:29][XXXXXXXXXXX][ERROR][Thruk] Icinga2: ERROR: Can't use an undefined value as a HASH reference. (/var/run/icinga2/cmd/livestatus)
  • Hi,

    Yes... this didn't change and other operations are running accordingly. At this point I dont´t know if this is an Icinga2 issue or a Thruk issue. The change that was made was the upgrade of the icinga2 version to 2.7.1-1.


    /etc/group :


    icingacmd:x:980:icinga,apache

    icingaweb2:x:979:apache

  • https://github.com/sni/Thruk/b…vider/Livestatus.pm#L1229 is the mentioned line. I don't understand the code there though.


    I would believe it has something to do with the stats fixes for Livestatus in 2.7.1 and the workaround in Thruk for older versions.

  • There is an issue open for that already: https://github.com/sni/Thruk/issues/762

    I just didn't have time to look into this yet.


    Besides that, the "balance all hosts and services" feature does not work with Icinga 2 anyway because it doesn't care about the force scheduled time. See https://github.com/Icinga/icinga2/issues/3868

  • Thanks!

    Regarding the "balance all hosts and services"... this is strange because it was working for me until this update and is one of the reasons we here use thruk.

    After altering icinga2 config and reloading the initial balance is bad and the icinga2 service nearly hangs the machine causing loads of 300 with our current configuration. I don't know if there is another way to define other rules to the initial schedule of Icinga2.


    Regardless... thanks for the info.