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

JSON API: Cannot connect to API #242

Open
doanbutar opened this issue Feb 28, 2022 · 6 comments
Open

JSON API: Cannot connect to API #242

doanbutar opened this issue Feb 28, 2022 · 6 comments

Comments

@doanbutar
Copy link

doanbutar commented Feb 28, 2022

What happened:
Json API not working and showing an error "JSON API: Cannot connect to API"

What you expected to happen:
I am trying to pull the API data directly through https://XXXX but not providing the data.
If I execute through cURL, it shows the data.

How to reproduce it (as minimally and precisely as possible):
Create a new data source JSON API and hit the Save and Test button.
image

Anything else we need to know?:
I am executing the curl command directly through the Grafana Linux server. There is no proxy involved between Grafana and Oracle EOM which I am trying to access the data.

Error logs:

t=2022-02-25T04:52:19-0700 lvl=dbug msg="Received command to update data source" logger=datasources url=https://<IPAddr>/me
t=2022-02-25T04:52:19-0700 lvl=dbug msg="Applying default URL parsing for this data source type" logger=datasource type=marcusolsson-json-datasource url=https://<IPAddr>/me
t=2022-02-25T04:52:19-0700 lvl=dbug msg="alert rules fetched" logger=ngalert count=9 disabled_orgs=[]
t=2022-02-25T04:52:20-0700 lvl=dbug msg="User granted access to execute action" logger=datasource.permissions userId=1 orgId=1 uname=admin datasourceId=10 action=Query
t=2022-02-25T04:52:20-0700 lvl=dbug msg="Querying for data source via SQL store" logger=datasources id=10 orgId=1
t=2022-02-25T04:52:20-0700 lvl=dbug msg="Applying default URL parsing for this data source type" logger=datasource type=marcusolsson-json-datasource url=https://<IPAddr>/me
t=2022-02-25T04:52:20-0700 lvl=eror msg="Data proxy error" logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/10 remote_addr=<IPAddr> referer=https://<grafanaIP>:3000/datasources/edit/fPB6ZGBnk/ error="http: proxy error: URLBlocked"
t=2022-02-25T04:52:20-0700 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/10 status=502 remote_addr=<IPAddr> time_ms=28 size=0 referer=https://<grafanaIP>:3000/datasources/edit/fPB6ZGBnk/

Environment:

  • Grafana version: 8.2.2
  • Data source type & version: marcusolsson-json-datasource @ 1.3.1
@neerajnagpal0408
Copy link

Hello

I am having the same error with

Grafana version: 8.4
Data source type & version: marcusolsson-json-datasource @ 1.3.1

========The log file========

logger=auth t=2022-03-04T22:49:38.29+0000 lvl=dbug msg="seen token" tokenId=47 userId=1 clientIP=10.60.18.131 userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36" authToken=dae460db2fac9f6552925d852bc5dc6c106aa6de01a926d3df42ccb35f89a37e
logger=context t=2022-03-04T22:49:38.29+0000 lvl=dbug msg="Updating last user_seen_at" user_id=1
logger=context t=2022-03-04T22:49:38.67+0000 lvl=dbug msg="Updating last user_seen_at" user_id=1
logger=context t=2022-03-04T22:49:38.83+0000 lvl=dbug msg="Updating last user_seen_at" user_id=1
logger=datasources t=2022-03-04T22:49:38.83+0000 lvl=dbug msg="Querying for data source via SQL store" id=7 orgId=1
logger=datasource t=2022-03-04T22:49:38.83+0000 lvl=dbug msg="Applying default URL parsing for this data source type" type=marcusolsson-json-datasource url=http://l****.devint.ocean.com:8091
logger=context t=2022-03-04T22:49:38.94+0000 lvl=info msg="Request Completed" method=GET path=/api/datasources/proxy/7 status=301 remote_addr=10.60.18.131 time_ms=111 size=258 referer=http://10.17.86.55:3000/datasources/edit/NyiPdDL7z
logger=ngalert t=2022-03-04T22:49:44.28+0000 lvl=dbug msg="alert rules fetched" count=0 disabled_orgs="unsupported value type"
^C

============================

@neerajnagpal0408
Copy link

Hello Checking if there are any updates on this request

@neerajnagpal0408
Copy link

Sorry can you clarify, what does these term status really mean -- "Kind/support Priority/awaiting-more-evidence"

@marcusolsson
Copy link
Contributor

@neerajnagpal0408 It basically means I need to reproduce this myself to be able to set better status labels.

Is there any URL that I can use to replicate this behavior? Sounds like something is blocking Grafana from accessing the URL. Do you have any VPNs or firewalls set up?

@neerajnagpal0408
Copy link

Thanks! I found out that this was was a warning only, the plug-in did work fine with the dashboard, despite this warning.

@unmilb
Copy link

unmilb commented Feb 20, 2023

Hi Marcus, This seems still an issue to me, I am using Grafana 9.3.6
The screenshot would help. Will share more info if needed.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

5 participants