question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parse error Invalid JSON. An error occurred on the server while parsing the JSON text.

See original GitHub issue

Describe 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:

image image

The error message that I get when I click on ‘Save & Test’ button:

image

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
7.1.1 5.0.1 4.0.0-alpha4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:47 (20 by maintainers)

github_iconTop GitHub Comments

3reactions
mplm17commented, Aug 28, 2020

@alexanderzobnin Here it is:

image

Here are 2 others examples that are working good, so we can see the differences:

-with postman:

image

-from another zabbix api client:

image

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

2reactions
alexanderzobnincommented, Aug 28, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zabbix API always returns Invalid JSON
I try to call the user.login method but somehow I always get "Invalid JSON. An error occurred on the server while parsing the...
Read more >
API Not Working : r/zabbix - Reddit
Parse error Invalid JSON. An error occurred on the server while parsing the JSON text. The URL i am using in my is...
Read more >
Error while parsing JSON Response in REST API Post call
I have copied and pasted the REST Request and Response JSON definitions into the Request and Response text boxes provided by OS REST...
Read more >
Invalid JSON Parser Error - Stack Overflow
I constructed this object as JSON string and try to assign it to a jQGrid. But it shows Invalid JSON Parser error. How...
Read more >
How to Fix the Invalid JSON Response Error in WordPress
If you use a firewall to protect your WordPress site, this can sometimes interfere with the editor's connection to your server and trigger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found