Open OlegSupport opened 1 year ago
could someone help me? oncall doesn't work with external grafana 9.3.1
same issue: https://github.com/grafana/oncall/issues/1035
not the same. i'm using grafana oncall in kubernetes EKS 1.24. not in docker-compose
I am also not able to communicate with external oncall I'm using GKE, and I get You are not authorized to communicate with the specified Grafana API - http://oncall-1672668006-grafana
Log error
2023-01-02 21:28:58 source=engine:uwsgi status=400 method=POST path=/api/internal/v1/plugin/self-hosted/install latency=0.028631 google_trace_id=- protocol=HTTP/1.1 resp_size=361 req_body_size=0
2023-01-02 21:29:42 source=engine:app google_trace_id=none logger=apps.grafana_plugin.helpers.client Error connecting to api instance 401 Client Error: Unauthorized for url: http://oncall-1672668006-grafana/api/org
2023-01-02 21:29:42 source=engine:app google_trace_id=none logger=root outbound latency=0.037018798997451086 status=401 method=HEAD url=http://oncall-1672668006-grafana/api/org slow=0
2023-01-02 21:29:42 source=engine:app google_trace_id=none logger=root inbound latency=0.054978 status=400 method=POST path=/api/internal/v1/plugin/self-hosted/install content-length=0 slow=0
2023-01-02 21:29:42 source=engine:app google_trace_id=none logger=django.request Bad Request: /api/internal/v1/plugin/self-hosted/install
2023-01-02 21:29:42 source=engine:uwsgi status=400 method=POST path=/api/internal/v1/plugin/self-hosted/install latency=0.056754 google_trace_id=- protocol=HTTP/1.1 resp_size=361 req_body_size=0
2023-01-02 21:29:45 source=engine:app google_trace_id=none logger=root inbound latency=0.000661 status=200 method=GET path=/ready/ content-length=0 slow=0
2023-01-02 21:29:45 source=engine:uwsgi status=200 method=GET path=/ready/ latency=0.001720 google_trace_id=- protocol=HTTP/1.1 resp_size=180 req_body_size=0
2023-01-02 21:29:45 source=engine:app google_trace_id=none logger=root inbound latency=0.000804 status=200 method=GET path=/health/ content-length=0 slow=0
2023-01-02 21:29:45 source=engine:uwsgi status=200 method=GET path=/health/ latency=0.002308 google_trace_id=- protocol=HTTP/1.1 resp_size=180 req_body_size=0
2023-01-02 21:30:07 source=engine:app google_trace_id=none logger=apps.grafana_plugin.helpers.client Error connecting to api instance 401 Client Error: Unauthorized for url: http://oncall-1672668006-grafana/api/org
I noticed that there is a variable called "externalGrafana" I left it that way
externalGrafana:
url: grafana.mydomain.com.br
and I disabled grafana
grafana:
enabled: false
Came to change the message:
An unknown error occured when trying to install the plugin. Are you sure that your OnCall API URL, https://oncall.mydomain.com.br, is correct?
Refresh your page and try again, or try removing your plugin configuration and reconfiguring.
Below is the error log in the Pod oncall-engine
2023-01-02 22:19:16 source=engine:uwsgi status=404 method=GET path=/grafana/api/live/ws latency=0.002917 google_trace_id=- protocol=HTTP/1.1 resp_size=394 req_body_size=0
2023-01-02 22:19:25 source=engine:app google_trace_id=none logger=root outbound latency=0.0004296669940231368 status=503 method=HEAD url=api/org slow=0
2023-01-02 22:19:25 source=engine:app google_trace_id=none logger=django.request Internal Server Error: /api/internal/v1/plugin/self-hosted/install
....
....
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 368, in prepare
self.prepare_url(url, params)
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL 'api/org': No scheme supplied. Perhaps you meant http://api/org?
2023-01-02 22:19:25 source=engine:app google_trace_id=none logger=root inbound latency=0.020012 status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install content-length=0 slow=0
2023-01-02 22:19:25 source=engine:uwsgi status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install latency=0.021294 google_trace_id=- protocol=HTTP/1.1 resp_size=372 req_body_size=0
Another test done was to add https to externalGrafana:
Changed the error again:
logger=plugindashboards t=2023-01-02T22:42:18.810158235Z level=info msg="Plugin state changed" pluginId=grafana-oncall-app enabled=true
logger=plugindashboards t=2023-01-02T22:42:18.810234443Z level=info msg="Syncing plugin dashboards to DB" pluginId=grafana-oncall-app
logger=context userId=139 orgId=1 uname=gilberto@mydomain.com.br t=2023-01-02T22:42:32.811461327Z level=error msg="Request Completed" method=POST path=/api/plugin-proxy/grafana-oncall-app/api/internal/v1/plugin/self-hosted/install status=504 remote_addr=10.100.10.41 time_ms=60228 duration=1m0.228374429s size=562 referer=https://grafana.mydomain.com.br/plugins/grafana-oncall-app handler=/api/plugin-proxy/:pluginId/*
logger=ngalert.sender.router rule_uid=mAK1_S4Vz org_id=1 t=2023-01-02T22:42:47.327611364Z level=info msg="Sending alerts to local notifier" count=1
I am also experiencing something similar:
2023-01-06 19:21:44 source=engine:app google_trace_id=none logger=root outbound latency=0.002253204999760783 status=503 method=HEAD url=api/org slow=0
2023-01-06 19:21:44 source=engine:app google_trace_id=none logger=django.request Internal Server Error: /api/internal/v1/plugin/self-hosted/install
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/etc/app/apps/grafana_plugin/views/self_hosted_install.py", line 33, in post
_, client_status = grafana_api_client.check_token()
File "/etc/app/apps/grafana_plugin/helpers/client.py", line 79, in check_token
return self.api_head("api/org")
File "/etc/app/apps/grafana_plugin/helpers/client.py", line 27, in api_head
return self.call_api(endpoint, requests.head, body)
File "/etc/app/apps/grafana_plugin/helpers/client.py", line 38, in call_api
response = http_method(call_status["url"], json=body, headers=self.request_headers)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 100, in head
return request("head", url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 368, in prepare
self.prepare_url(url, params)
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL 'api/org': No scheme supplied. Perhaps you meant http://api/org?
Just restarting External grafana pods solved my issue
i have another error
2023-02-14 20:47:43 source=engine:app google_trace_id=none logger=root inbound latency=0.014148 status=200 method=GET path=/api/internal/v1/cloud_connection content-length=0 slow=0 user_id=2 org_id=1
2023-02-14 20:47:43 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/cloud_connection latency=0.015668 google_trace_id=- protocol=HTTP/1.1 resp_size=365 req_body_size=0
2023-02-14 20:47:44 source=engine:app google_trace_id=none logger=root inbound latency=0.010535 status=200 method=GET path=/api/internal/v1/live_settings content-length=0 slow=0 user_id=2 org_id=1
2023-02-14 20:47:44 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/live_settings?search= latency=0.011650 google_trace_id=- protocol=HTTP/1.1 resp_size=6965 req_body_size=0
2023-02-14 20:47:44 source=engine:app google_trace_id=none logger=apps.oss_installation.models.cloud_connector Unable to sync with cloud. GRAFANA_CLOUD_ONCALL_TOKEN is invalid
2023-02-14 20:47:44 source=engine:app google_trace_id=none logger=root inbound latency=0.186894 status=200 method=PUT path=/api/internal/v1/live_settings/LAGFHWZMMKYZM content-length=112 slow=0 user_id=2 org_id=1
2023-02-14 20:47:44 source=engine:uwsgi status=200 method=PUT path=/api/internal/v1/live_settings/LAGFHWZMMKYZM?sync_users=false latency=0.188640 google_trace_id=- protocol=HTTP/1.1 resp_size=424 req_body_size=112
2023-02-14 20:47:44 source=engine:app google_trace_id=none logger=root inbound latency=0.011728 status=200 method=GET path=/api/internal/v1/current_team content-length=0 slow=0 user_id=2 org_id=1
2023-02-14 20:47:44 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/current_team latency=0.012912 google_trace_id=- protocol=HTTP/1.1 resp_size=770 req_body_size=0
2023-02-14 20:47:44 source=engine:app google_trace_id=none logger=root inbound latency=0.089292 status=200 method=GET path=/api/internal/v1/cloud_connection content-length=0 slow=0 user_id=2 org_id=1
2023-02-14 20:47:44 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/cloud_connection latency=0.090626 google_trace_id=- protocol=HTTP/1.1 resp_size=365 req_body_size=0
GRAFANA_CLOUD_ONCALL_TOKEN is invalid
I have my local grafana with local oncall, telegram work fine, url by oncall open on world with https, API Key i created in https://blablabla.grafana.net/a/grafana-oncall-app/settings what i do wrong????
OMFG Grafana please update Documemtation..... if you got this error just add env GRAFANA_CLOUD_ONCALL_API_URL=$From_Cloud_OnCall_Url
OMFG Grafana please update Documemtation..... if you got this error just add env GRAFANA_CLOUD_ONCALL_API_URL=$From_Cloud_OnCall_Url
Thanks for the solution. I was unable to connect OSS OnCall with Cloud OnCall until I set the GRAFANA_CLOUD_ONCALL_API_URL
env.
I had the same issue where oncall was telling me "No scheme supplied".
Adding the scheme http://
in the externalGrafana
for me as the fix.
externalGrafana:
url: http://grafana.grafana.svc.cluster.local:80
I had the same issue where oncall was telling me "No scheme supplied". Adding the scheme
http://
in theexternalGrafana
for me as the fix.externalGrafana: url: http://grafana.grafana.svc.cluster.local:80
you need to external url be visible to the entire internet
use nginx proxy or alternative or port forwarding
and https necessarily
I had the same issue where oncall was telling me "No scheme supplied". Adding the scheme
http://
in theexternalGrafana
for me as the fix.externalGrafana: url: http://grafana.grafana.svc.cluster.local:80
you need to external url be visible to the entire internet
use nginx proxy or alternative or port forwarding
and https necessarily
Not entirely true. My OnCall and Grafana are running inside kubernetes. They can access each other without making use of the public internet (which would be bad practice in kubernetes).
For grafana cloud connect you need public access
In on-call helm values.yaml :
Not working :
externalGrafana:
url: https://grafana.monitoring.com
update with internal k8s fqdn & it work
externalGrafana:
url: http://grafana.monitoring.svc.cluster.local:3000
Once update with internal k8s fqdn from grafana plugin able to connect the Oncall engine backend
In on-call helm values.yaml :
Not working :
externalGrafana: url: http://grafana.monitoring.com
update with internal k8s fqdn & it work
externalGrafana: url: http://grafana.monitoring.svc.cluster.local:3000
Once update with internal k8s fqdn from grafana plugin able to connect the Oncall engine backend
Show you cluster name
kubectl exec -it $POD_NAME -- cat /etc/resolv.conf
by default svc grafana called kube-prometheus-grafana
so you url http://kube-prometheus-grafana.monitoring.svc.cluster.local:80
just look kubectl -n monitoring get svc
In grafana instance in eks, when plugin try to connect to OnCall backend i'm seeing this error:
Logs at the same time from oncall-engine:
Logs from oncall-celery: