grafana / grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource
Apache License 2.0
733 stars 91 forks source link

[Bug] invalid character 'þ' looking for beginning of value #977

Open stuartp44 opened 1 month ago

stuartp44 commented 1 month ago

Describe the bug

When calling a JSON API where the response is a raw file containing JSON payload the plugin does not handle it very well and throws a strange error that does not help diagnose the issue. The error actually comes through as "error while performing the infinity query. unable to parse response body as JSON. invalid character 'þ' looking for beginning of value" which causes confusion.

This took me a while to see what was the issue here as Postman nicely silently handles it if the file is streamed to me and renders the JSON with no issues. However, infinity on the other hand does not and throws a error as above.

Steps to reproduce

Provide steps to reproduce the issue.

Create new backend JSON query pointing to the AWS Health announcements API aka "https://health.aws.amazon.com/public/currentevents".
Image

Sample Data

This data changes regular, due to the fact its health status orientated. []

or when there is something

"codebuild-us-east-1": [
        {
            "arn": null,
            "status": "1",
            "date": "1693492488",
            "event_log": [
                {
                    "message": "We can confirm increased Build error rates in the US-EAST-1 Region. We have identified the root cause and are working toward resolution.",
                    "summary": "Increased Error Rates for Builds",
                    "status": "1",
                    "timestamp": 1693492488
                },
                {
                    "message": "Between 6:30 AM and 7:35 AM PDT we experienced increased Build errors rates in the US-EAST-1 Region. A subset of impacted builds were unable to start execution and thus customers will have seen failed builds that were unable to produce logs. The issue has been resolved and the service is operating normally.",
                    "summary": "[RESOLVED] Increased Error Rates for Builds",
                    "status": "0",
                    "timestamp": 1693494397
                }
            ]
        }
    ]

Screenshots

Image

Version Details:

IlyaSkach commented 43 minutes ago

I have the same problem. Someone solved it?