-
Notifications
You must be signed in to change notification settings - Fork 65
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
Can't connect to API when URL contains encoded slash #59
Comments
@marcusolsson Thank you for fixing the issue. How I get the updated plugin version on grafana.com (Grafana Cloud)? |
The fix is available in v1.0.1. You should be able to update it by installing the latest version. |
You should be able to upgrade from the marketplace. If you go to this URL: https://grafana.com/grafana/plugins/marcusolsson-json-datasource/installation?version=1.0.1 Do you see this button? |
Ah, ok. I see. Updated. (not a user friendly way to update a plugin 😀) |
Marcus, did you test your fix with the url above After the update i get an error "Stream 0x688759bcbb6adf32a07e91f6de84d181b252e655%2Fstreamr%2Fgrowth%2Fstreams not found." Encoding issue? |
It looks like it's working as intended, no? Are you sure the resource exists? |
Of course, the resource is available and returns a valid JSON https://streamr.network/api/v1/streams/0x688759bcbb6adf32a07e91f6de84d181b252e655%2Fethereum-gas-prices/data/partitions/0/last |
Hm. Weird thing is that you're getting an API error saying that the resource doesn't exist. And the resource name looks correct? Not sure what's happening here. |
The error message says, the stream is not found. The stream is the encoded part of the url: The Grafana JSON plugin (or Grafana Core?) creates a broken request url, so that the API endpoint can't resolve the encoded stream within the requested url. Let me explain
Please compare the encoded slashes:
|
This is weird. It seems like there's some magic happening in the Grafana proxy. If I make the request through the proxy, it fails.
But if I make the request directly from the browser, it succeeds even without the earlier "fix".
I'll have to look closer at what the proxy does with the request. I've reverted the previous commit for now. Thanks for the patience on this. |
Hi, i know its now 2022, But i did try to setup an json api (http://IP/api/v2/status) and it is not working it says network error, But on the raspberry pi where my grafana is installed , a normal curl request works fine. I did try to setup another api without a slash and it works. Any fix for that? |
Hello.
Whenever I want to create a data source with the JSON API plugin I get an error message: “JSON API: Cannot connect to API”. But only for URLs that have an encoded slash, e.g. https://streamr.network/api/v1/streams/0x688759bcbb6adf32a07e91f6de84d181b252e655%2Fethereum-gas-prices/data/partitions/0/last - I can request the URL in a browser without errors.
Any idea? Should I encode/escape any character more?
Thank you.
The text was updated successfully, but these errors were encountered: