-
Problem report
-
Resolution: Fixed
-
Trivial
-
6.2.1rc1, 6.4.0alpha1
-
Sprint 90 (Jul 2022), Sprint 91 (Aug 2022)
-
0.25
Steps to reproduce:
1) Turn on Server and agent. Use postgresql database.
2) Collect some data.
3) Create Graph widget with host and any item (that has data).
Graph parameters:
Draw - Line.
Aggregation function - avg (any except none).
Aggregation interval - empty (remove existing values).
4) Add widget.
Result:
Runtime error:
pg_query(): Query failed: ERROR: division by zero [zabbix.php:22 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerWidgetSvgGraphView->doAction() -> CSvgGraphHelper::get() -> CSvgGraphHelper::getMetricsAggregatedData() -> CHistoryManager->getAggregationByInterval() -> CHistoryManager->getAggregationByIntervalFromSql() -> DBselect() -> pg_query() -> CConfigFile->{closure}() in include/db.inc.php:254]
alseo, maybe this helps:
Error in query [SELECT itemid, CAST(clock AS BIGINT)- MOD(CAST(clock AS BIGINT),0) AS tick, MAX(value) AS value, MAX(clock) AS clock FROM history_uint WHERE itemid=42243 AND clock >= '1657532560' AND clock <= '1657536160' GROUP BY itemid, CAST(clock AS BIGINT)- MOD(CAST(clock AS BIGINT),0)] [ERROR: division by zero]
Expected:
No runtime errors