PHP runtime error is diplayed on widget that listens to Item history in case when Item history selected item has no data yet

XMLWordPrintable

    • S26-W10/11
    • 1

      Steps to reproduce:

      1. Add Item history widget, in columns section select item that does not have data yet, for example, Available memory (Numeric (unsigned))
      2. Add Item value widget and for Item Select->widget Item history
      3. Add Gauge widget and for Item Select->widget Item history
      4. Starting from 7.4, add Item card widget and for Item Select->widget Item history

      Result:
      PHP runtime error appear for Item value and Gauge widgets:

      Error is displayed for Item card widget, even, if item with numeric type of information is selected for Item history :

      Invalid parameter "Item/1": a number is expected.

      Expected:
      Item value, Gauge and Item card widgets should display status Awaiting data instead of errrors:

      Error message:

      array_flip(): Can only flip string and integer values, entry skipped [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerDashboardWidgetView->checkInput() → Zabbix\Core\CWidget->getForm() → Widgets\Item\Includes\WidgetForm->__construct() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → dbConditionInt() → array_flip() → CConfigFile->{closure}() in conf/zabbix.conf.php:89]
      pg_query(): Query failed: ERROR: syntax error at or near ")"
      LINE 1: ...units FROM items i WHERE i.flags IN (0,4) AND i.itemid IN ()
      ^ [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerDashboardWidgetView->checkInput() → Zabbix\Core\CWidget->getForm() → Widgets\Item\Includes\WidgetForm->__construct() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → DBselect() → pg_query() → CConfigFile->{closure}() in conf/zabbix.conf.php:89]
      Error in query [SELECT i.itemid,i.units FROM items i WHERE i.flags IN (0,4) AND i.itemid IN ()] [ERROR: syntax error at or near ")"
      LINE 1: ...units FROM items i WHERE i.flags IN (0,4) AND i.itemid IN ()
      ^] [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerDashboardWidgetView->checkInput() → Zabbix\Core\CWidget->getForm() → Widgets\Item\Includes\WidgetForm->__construct() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → DBselect() → trigger_error() → CConfigFile->{closure}() in conf/zabbix.conf.php:89]
      Invalid parameter "Item/1": a number is expected.
      

            Assignee:
            Dmitrijs Fofanovs
            Reporter:
            Julija Zelezova
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: