Hi I am newbie to icinga.iam getting this error in icingaweb2 gui

Oops, an error occurred!

count(): Parameter must be an array or an object that implements Countable (QueryBasedTable.php:113)

#0 [internal function]: Icinga\Application\ApplicationBootstrap->Icinga\Application{closure}(2, ‘count(): Parame…’, ‘/usr/share/icin…’, 113, Array) #1 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/QueryBasedTable.php(113): count(NULL) #2 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Html/BaseElement.php(133): dipl\Web\Table\QueryBasedTable->renderContent() #3 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Html/Html.php(171): dipl\Html\BaseElement->render() #4 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Html/BaseElement.php(105): dipl\Html\Html->render() #5 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Html/BaseElement.php(133): dipl\Html\BaseElement->renderContent() #6 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Html/Html.php(259): dipl\Html\BaseElement->render() #7 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Zf1/SimpleViewRenderer.php(47): dipl\Html\Html->__toString() #8 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Zf1/SimpleViewRenderer.php(66): dipl\Zf1\SimpleViewRenderer->render() #9 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): dipl\Zf1\SimpleViewRenderer->postDispatch() #10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch() #11 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(‘deploymentsActi…’) #12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response)) #13 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response)) #14 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch() #15 /usr/share/icingaweb2/public/index.php(4): require_once(’/usr/share/php/…’) #16 {main}

Hi, welcome to the community :slight_smile:

to help you we need some more details of your system.
Which version of director are you using? Which OS and PHP version?

Greetz

1 Like

Hi Alex ,
thanks for your reply ,Well i resolved the issue which was due to php version problem , i just changed the code in /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/QueryBasedTable.php

public function renderContent()
{
$columns = $this->getColumnsToBeRendered();
if (isset($columns) && count($columns)) {
$this->generateHeader();
}

    $this->fetchRows();

    return parent::renderContent();

Hi,

you should update the module not the file itself, thats why i asked for the director version.
This error was fixed with this pull request and director version 1.5.0 (latest 1.7.2).

Greetz

Hi Alex ,
thank you for the reply.

Check the docs:)
https://icinga.com/docs/director/latest/doc/05-Upgrading/#upgrading

1 Like