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

The oncall plugin does not connect. #5475

Open
Bolywar opened this issue Mar 3, 2025 · 4 comments
Open

The oncall plugin does not connect. #5475

Bolywar opened this issue Mar 3, 2025 · 4 comments

Comments

@Bolywar
Copy link

Bolywar commented Mar 3, 2025

What went wrong?

What happened:

After the latest changes, the oncall plugin stopped connecting

What did you expect to happen:

I expected it to work normally

How do we reproduce it?

  1. Deploy helm
  2. Try to connect plugin

Grafana OnCall Version

1.15.2

Product Area

Helm/Kubernetes/Docker

Grafana OnCall Platform?

Kubernetes

User's Browser?

No response

Anything else to add?

No response

@zhou-mo
Copy link

zhou-mo commented Mar 10, 2025

Hi @Bolywar,

I met the same issue in grafana oncall v1.15.0 last week. I think it may be a bug in oncall plugin when RBACEnabled is true.
The error occurred when grafana call API api/plugins/grafana-oncall-app/resources/plugin/status for oncall plugin connection. It will trigger an API call /api/access-control/users/1/permissions to grafana but grafana won't process the path any more.

You could check the log of your grafana pod and find such error log:

logger=context userId=xxx orgId=xxx uname=sa-1-sa-autogen-oncall t=xxx level=info msg="Request Completed" method=GET path=/api/access-control/users/1/permissions status=404 remote_addr=xxx time_ms=5 duration=5.295902ms size=24 referer= handler=notfound status_source=server

You could add a config in grafana.ini to work around the issue.

[feature_toggles]
accessControlOnCall = false

@Bolywar
Copy link
Author

Bolywar commented Mar 10, 2025

grafana.ini

grafana:
  enabled: true
  grafana.ini:
    server:
      domain: mydomain.net
      root_url: "%(protocol)s://%(domain)s/grafana/"
      serve_from_sub_path: true
    feature_toggles:
      enable: externalServiceAccounts
      accessControlOnCall: false

@Bolywar
Copy link
Author

Bolywar commented Mar 10, 2025

log

logger=plugin.grafana-oncall-app t=2025-03-10T15:29:36.852244632Z level=error msg="Error validating oncall plugin settings" error="error making request: Get \"http://mydomen.net/grafana/api/org\": dial tcp 192.168.122.53:80: connect: connection refused"
logger=context userId=1 orgId=1 uname=admin t=2025-03-10T15:29:36.852411024Z level=error msg="Request Completed" method=GET path=/api/plugins/grafana-oncall-app/resources/plugin/status status=500 remote_addr=192.168.122.52 time_ms=42 duration=42.966012ms size=126 referer=https://mydomen.net/grafana/plugins/grafana-oncall-app handler=/api/plugins/:pluginId/resources/* status_source=downstream
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.337905674Z level=error msg="getting incident plugin settings" error="error making request: Get \"http://mydomen.net/grafana/api/plugins/grafana-incident-app/settings\": dial tcp 192.168.122.53:80: connect: connection refused, http://mydomen.net/grafana/api/plugins/grafana-incident-app/settings"
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.341814371Z level=error msg="getting labels plugin settings" error="error making request: Get \"http://mydomen.net/grafana/api/plugins/grafana-labels-app/settings\": dial tcp 192.168.122.53:80: connect: connection refused, http://mydomen.net/grafana/api/plugins/grafana-labels-app/settings"
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.347315139Z level=info msg=GetSyncData time=3
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.347549698Z level=error msg="Error getting sync data" error="error getting users = error making request: Get \"http://mydomen.net/grafana/api/org/users\": dial tcp 192.168.122.53:80: connect: connection refused"
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.368740637Z level=info msg=GetUser user="map[Email:admin@localhost Login:admin Name:admin Role:Admin]"
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.372533238Z level=error msg="Error getting user" error="error making request: Get \"http://mydomen.net/grafana/api/org/users\": dial tcp 192.168.122.53:80: connect: connection refused"
logger=plugin.grafana-oncall-app t=2025-03-10T15:29:46.372656127Z level=error msg="Error validating oncall plugin settings" error="error setting up request headers: error making request: Get \"http://mydomen.net/grafana/api/org/users\": dial tcp 192.168.122.53:80: connect: connection refused "
logger=context userId=1 orgId=1 uname=admin t=2025-03-10T15:29:46.373276017Z level=error msg="Request Completed" method=GET path=/api/plugins/grafana-oncall-app/resources/plugin/status status=500 remote_addr=192.168.122.52 time_ms=18 duration=18.741004ms size=167 referer=https://mydomen.net/grafana/plugins/grafana-oncall-app handler=/api/plugins/:pluginId/resources/* status_source=downstream

@Bolywar
Copy link
Author

Bolywar commented Mar 11, 2025

solved by replacing the paths

grafana.ini:
    server:
      domain: oncall-grafana.grafana.svc.cluster.local
      root_url: "%(protocol)s://%(domain)s/grafana/"
      serve_from_sub_path: true
    feature_toggles:
      enable: externalServiceAccounts
      accessControlOnCall: false
grafana-oncall-app-provisioning.yaml:
   apps:
      - type: grafana-oncall-app
        name: grafana-oncall-app
        disabled: false
        jsonData:
          stackId: 5
          orgId: 100
          onCallApiUrl: http://oncall-engine.grafana.svc.cluster.local:8080

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

No branches or pull requests

2 participants