Icinga / icingaweb2-module-cube

Drill-down view for Icinga web 2 based on custom variables
GNU General Public License v2.0
45 stars 12 forks source link

Undefined property when sorting cubes for severity in some views #160

Closed mocdaniel closed 5 months ago

mocdaniel commented 9 months ago

Describe the bug

When sorting cube views for severity, the view sometimes crashes with the following error message:

Undefined property: stdClass::$hosts_unhandled_unreachable

The stacktrace is as follows:

#0 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(280): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}()
#1 [internal function]: Icinga\Module\Cube\CubeRenderer->Icinga\Module\Cube\{closure}()
#2 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(288): uasort()
#3 /usr/share/icingaweb2/modules/cube/library/Cube/CubeRenderer.php(211): Icinga\Module\Cube\CubeRenderer->Icinga\Module\Cube\{closure}()
#4 /usr/share/icingaweb2/modules/cube/library/Cube/Cube.php(339): Icinga\Module\Cube\CubeRenderer->render()
#5 /usr/share/icingaweb2/modules/cube/application/views/scripts/cube-index.phtml(20): Icinga\Module\Cube\Cube->render()
#6 /usr/share/php/Icinga/Web/View.php(235): include(String)
#7 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/View/Abstract.php(886): Icinga\Web\View->_run()
#8 /usr/share/icingaweb2/modules/cube/library/Cube/Web/Controller.php(170): Zend_View_Abstract->render()
#9 /usr/share/icingaweb2/modules/cube/application/controllers/HostsController.php(19): Icinga\Module\Cube\Web\Controller->renderCube()
#10 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Module\Cube\Controllers\HostsController->indexAction()
#11 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#12 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
#13 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch()
#14 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#15 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#16 {main}

We tried different filters, but could not recognize a pattern of filter settings crashing vs. filter settings succeeding.

To Reproduce

No clear way of reproducing this. We hope, the stacktrace hints at some bug. Kindly get back to us if you need more information

Expected behavior

All possible filters should succeed when being sorted by severity.

Your Environment

Include as many relevant details about the environment you experienced the problem in

tbauriedel commented 9 months ago

ref/NC/801888

RincewindsHat commented 7 months ago

Fiddled around with that a bit. So far it looks like the problem emerges, if there are multiples cubes in which hosts are DOWN.

For now I think it is related with the sorted by reachability. https://github.com/Icinga/icingaweb2-module-cube/blob/10192ca03302937ab9513e8188829538a74dc744/library/Cube/CubeRenderer/HostStatusCubeRenderer.php#L134