grafana / oncall

Developer-friendly incident response with brilliant Slack integration
GNU Affero General Public License v3.0
3.44k stars 276 forks source link

OnCall was not able to load the current user. Try refreshing the page #3772

Open RajaRanjeetKumarReddy opened 7 months ago

RajaRanjeetKumarReddy commented 7 months ago

What went wrong?

im getting OnCall was not able to load the current user. Try refreshing the page

my plugin is connecting to grafana but it is not loading getting OnCall was not able to load the current user. Try refreshing the page

-

How do we reproduce it?

  1. Open Grafana OnCall and do X
  2. Now click button Y
  3. Wait for the browser to crash. Error message says: "Error..."

Grafana OnCall Version

v1.3.94

Product Area

Auth

Grafana OnCall Platform?

Kubernetes

User's Browser?

chrome

Anything else to add?

grafana oncall
MarkOWiesemann commented 7 months ago

Having the same problem, my filtered logs:

celery_1 | 2024-02-01 19:12:31,372 source=engine:celery worker=ForkPoolWorker-2 task_id=cb61aaf3-6039-427e-a563-a86e7fbf4fb9 task_name=apps.grafana_plugin.tasks.sync.plugin_sync_organization_async name=apps.grafana_plugin.helpers.client level=WARNING Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/access-control/users/permissions/search?actionPrefix=grafana-oncall-app (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc0b09a25d0>: Failed to establish a new connection: [Errno -2] Name does not resolve')) celery_1 | 2024-02-01 19:12:31,374 source=engine:celery worker=ForkPoolWorker-2 task_id=cb61aaf3-6039-427e-a563-a86e7fbf4fb9 task_name=apps.grafana_plugin.tasks.sync.plugin_sync_organization_async name=apps.grafana_plugin.helpers.client level=WARNING Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/org (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc0b09ba210>: Failed to establish a new connection: [Errno -2] Name does not resolve')) engine_1 | 2024-02-01 19:12:31 source=engine:app google_trace_id=none logger=apps.grafana_plugin.helpers.client Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/access-control/users/permissions/search?actionPrefix=grafana-oncall-app (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdecf0835d0>: Failed to establish a new connection: [Errno -2] Name does not resolve')) engine_1 | 2024-02-01 19:12:31 source=engine:app google_trace_id=none logger=apps.grafana_plugin.helpers.client Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/org (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdecf083ed0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

kahramanakyil commented 7 months ago

Having the same problem with docker env. and exactly same logs.

jusvit commented 6 months ago

Having same issue (on the cloud version)

jusvit commented 6 months ago

Seems to have resolved itself

melquisedequecosta98 commented 5 months ago

Here the error remains. Helm version "1.3.117"

lianghuiyuan commented 5 months ago

the same error. oncall version: 1.3.82

melquisedequecosta98 commented 5 months ago

To get around the situation, what worked for me was setting the external grafana url in the oncall pointing to the grafana service. It was necessary to build the "on call" from scratch. Im provisioned from terraform and using helm chart.

In the helm release: resource "helm_release" "oncall" { name = "xxx" repository = "https://grafana.github.io/helm-charts" chart = "oncall" version = "1.3.117"

set { name = "grafana.grafana.ini.server.domain" value = "http://nameServiceGrafana" }

In the value from oncall:

externalGrafana: url: "http://nameServiceGrafana"

yzy317 commented 5 months ago

I have a grafana instance already.

And i have same issue . (use docker-compose)

source=engine:celery worker=ForkPoolWorker-2 task_id=cb61aaf3-6039-427e-a563-a86e7fbf4fb9 task_name=apps.grafana_plugin.tasks.sync.plugin_sync_organization_async name=apps.grafana_plugin.helpers.client level=WARNING Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/org (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc0b09ba210>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

I guess this container can't resolve the host : grafana, so i add config in this docker-compose **extra_hosts:

And docker-compose up -d again. Resolve this promblem finally.

joaoferreira-git commented 3 months ago

I have the same issue but I believe i found the issue, the issue atleast with me is that my grafana instance is runnning on port 9010 and no matter what i add into the GRAFANA_API_URL or directly into the docker compose it always uses the port 3000 to connect to the grafana API, there needs to be a ENV to override the port or atleast look into why the GRAFANA_API_URL ENV is not overwriting the default 3000 port. To test this i changed the grafana port to the default of 3000 an it started working.

blmeira commented 1 month ago

When registering the plugin in Grafana, Oncall makes async requests to whatever is configured as the root_url of the grafana.ini (like the OAuth callbacks).

So in the registration phase, it ignores GRAFANA_API_URL in favor of that. Is there a way to overcome this? Or at least a location we can provide the correct SSL certs without running something like update-ca-certificates (I have this issue in Kubernetes with Grafana behind ingress)

mderynck commented 1 week ago

Recently we made some changes to the way Grafana OnCall is initialized. Use 1.9.22, there were quite a few changes along the way from 1.9.0-1.9.22 to get things working.