Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 400 after upgrading grafana from 10.2.2 to 10.2.3 #1768

Closed
jmhg2 opened this issue Dec 29, 2023 · 6 comments
Closed

Error 400 after upgrading grafana from 10.2.2 to 10.2.3 #1768

jmhg2 opened this issue Dec 29, 2023 · 6 comments

Comments

@jmhg2
Copy link

jmhg2 commented Dec 29, 2023

After upgrading grafana from 10.2.2 to 10.2.3, existing dashboards using zabbix-grafana plugin return error 400 in Metrics panels

When changing again to 10.2.2 the dashboards are working fine. Looking for the error it seems that the query is malformed because executing the query in the database gives an error

image
image

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
10.2.3 6.0.14 4.4.4
@maxtymchenko
Copy link

maxtymchenko commented Jan 2, 2024

I can confirm this reproducible on the latest version of Zabbix server 6 LTS - 6.0.25

offending queries comparison between Grafana 10.2.2 and 10.2.3 :

10.2.2 (working):

SELECT to_char(itemid, 'FM99999999999999999999') AS metric, clock / 15 * 15 AS time, AVG(value) AS value FROM history_uint WHERE itemid IN (42243) AND clock > 1704181979 AND clock < 1704203579 GROUP BY 1, 2 ORDER BY time ASC

10.2.3 (broken):

SELECT CAST(itemid AS CHAR) AS metric, clock DIV 15 * 15 AS time_sec, AVG(value) AS value FROM history_uint WHERE itemid IN (42243) AND clock > 1704179801 AND clock < 1704201401 GROUP BY clock DIV 15 * 15, metric ORDER BY time_sec ASC

PS those queries are for the same item on the same server - i.e. no changes on zabbix side

@maxtymchenko
Copy link

Further investigation shows that "Direct DB connection" setting has been emptied after upgrade onto grafana v 10.2.3

Zabbix data source cannot see any Postgres DB anymore (however can see mysql ones)

finally, grafana-zabbix is getting confused by the code grafana-zabbix-main\src\datasource\zabbix\connectors\sql\sqlConnector.ts:

loadSQLDialect() {
if (this.datasourceTypeId === supportedDatabases.postgres) {
this.sqlDialect = postgres;
} else {
this.sqlDialect = mysql;
}
}

which explains the malformed query

@maxtymchenko
Copy link

related to #1764

@daFlo
Copy link

daFlo commented Jan 8, 2024

+1

Grafana: 10.2.3
Zabbix: 6.4.10
Grafana-Zabbix Plugin: 4.4.4

@gabor
Copy link
Contributor

gabor commented Jan 8, 2024

summary of the probable cause:

@gabor
Copy link
Contributor

gabor commented Jan 8, 2024

this seems to be duplicate of #1764 , closing this one.

@gabor gabor closed this as completed Jan 8, 2024
@github-project-automation github-project-automation bot moved this to Complete in OSS Big Tent Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

No branches or pull requests

4 participants