Parse error Invalid JSON. An error occurred on the server while parsing the JSON text.
See original GitHub issueDescribe the bug Zabbix API cannot be accessed by v4.0.0-alpha4 plugin, while v3.12.2 and older versions could. When saving config of zabbix datasource, the following message appears:
Parse error Invalid JSON. An error occurred on the server while parsing the JSON text.
Expected behavior
Datasource configuration should be saved correctly. From grafana server, the following command returns a normal response:
curl -k -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"apiinfo.version","params":[],"id":1}' https://zabbix/api_jsonrpc.php
returns:
{"jsonrpc":"2.0","result":"5.0.1","id":1}
Screenshots Here is my datasource conf, which works properly in stable versions:
The error message that I get when I click on ‘Save & Test’ button:
Software versions
Grafana | Zabbix | Grafana-Zabbix Plugin |
---|---|---|
7.1.1 | 5.0.1 | 4.0.0-alpha4 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:47 (20 by maintainers)
Top GitHub Comments
@alexanderzobnin Here it is:
Here are 2 others examples that are working good, so we can see the differences:
-with postman:
-from another zabbix api client:
With these outputs, I tried to reproduce the problem on postman by setting the same headers that are set in grafana requests. It seems that if “Content-Length” header is set, it works properly, but if it’s not set, we have the parse error…
Hope this will help
Ok, tried to solve it. Could anyone test it out and confirm that bug fixed? Here’s a built package for all platforms. Just unpack it into grafana plugins folder.
grafana-zabbix-8f70a0c.zip