PHP and SQL related errors in SVG graph and Pie chart widgets if they listen for items from more than 1 widget

XMLWordPrintable

      Problem description: In case if SVG graph widget or Pie chart widget are listening to items from more than one widget, a PHP error (on SVG graph) or an SQL error (on Pie chart) are observer in these widgets:
      In SVG ghraph widget:

      array_flip(): Can only flip string and integer values, entry skipped [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → Widgets\SvgGraph\Actions\WidgetView->doAction() → Widgets\SvgGraph\Includes\CSvgGraphHelper::get() → Widgets\SvgGraph\Includes\CSvgGraphHelper::getMetricsItems() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → dbConditionInt() → array_flip() → CConfigFile->{closure}() in conf/zabbix.conf.php:87]
      array_flip(): Can only flip string and integer values, entry skipped [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → Widgets\SvgGraph\Actions\WidgetView->doAction() → Widgets\SvgGraph\Includes\CSvgGraphHelper::get() → Widgets\SvgGraph\Includes\CSvgGraphHelper::getMetricsItems() → array_flip() → CConfigFile->{closure}() in conf/zabbix.conf.php:87]
      

      In Pie chart widget:

      pg_query(): Query failed: ERROR: invalid input syntax for type bigint: ""
      LINE 1: ...rn.itemid WHERE i.flags IN (0,4) AND i.itemid IN ('',400695)...
      ^ [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → Widgets\PieChart\Actions\WidgetView->doAction() → Widgets\PieChart\Actions\WidgetView->getData() → Widgets\PieChart\Actions\WidgetView::getItems() → Widgets\PieChart\Actions\WidgetView::getMetricsSingleItemDS() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → DBselect() → pg_query() → CConfigFile->{closure}() in conf/zabbix.conf.php:87]
      Error in query [SELECT i.itemid,i.hostid,i.history,i.trends,i.units,i.value_type,COALESCE(irn.name_resolved,'') AS name_resolved FROM items i LEFT JOIN item_rtname irn ON i.itemid=irn.itemid WHERE i.flags IN (0,4) AND i.itemid IN ('',400695) AND i.value_type IN (0,3) LIMIT 50] [ERROR: invalid input syntax for type bigint: ""
      LINE 1: ...rn.itemid WHERE i.flags IN (0,4) AND i.itemid IN ('',400695)...
      ^] [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → Widgets\PieChart\Actions\WidgetView->doAction() → Widgets\PieChart\Actions\WidgetView->getData() → Widgets\PieChart\Actions\WidgetView::getItems() → Widgets\PieChart\Actions\WidgetView::getMetricsSingleItemDS() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CItem->get() → DBselect() → trigger_error() → CConfigFile->{closure}() in conf/zabbix.conf.php:87]
      

      Steps to reproduce:

      1. Create a dashboard
      2. Create a honeycomb widget and an Item history widget on the same page
      3. Add an SVG graph widget with two data sets to the same page:
        1. The first dataset listens for items from the Honeycomb widget
        2. The second dataset listens for items from Item history widget
      4. Add a Pie chart widget with to data sets to the same page:
        1. The first dataset listens for items from the Honeycomb widget
        2. The second dataset listens for items from Item history widget
      5. Save dashboard configuration
      6. Open dashboard in view mode

      Result: The above errors are observed in the widgets
      Expected: No errors should be observed in the widgets

      Example:

            Assignee:
            Zabbix Development Team
            Reporter:
            Sergejs Olonkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: