grafana / oncall

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

oncall plugin broken after upgrade to 1.13.3: token already exists #5290

Open bpedersen2 opened 2 days ago

bpedersen2 commented 2 days ago

What went wrong?

What happened: Upgrade oncall plugin from 1.12.1 to 1.13.3 (after upgrading oncall to the same version)

plugin gets disabled by grafana:

logger=plugin.installer t=2024-11-22T09:02:55.5291324Z level=info msg="Installing plugin" pluginId=grafana-oncall-app version=1.13.3
logger=installer.fs t=2024-11-22T09:02:56.677728374Z level=info msg="Downloaded and extracted grafana-oncall-app v1.13.3 zip successfully to /var/lib/grafana/plugins/grafana-oncall-app"
logger=serviceauth.extsvcaccounts t=2024-11-22T09:02:57.114809775Z level=info msg="Generate new service account token" service=grafana-oncall-app orgID=1
logger=serviceauth.extsvcaccounts t=2024-11-22T09:02:57.124431175Z level=error msg="Could not get the external svc token" service=grafana-oncall-app saID=38 error="[serviceaccounts.ErrTokenAlreadyExists] service account token with name extsvc-token-grafana-oncall-app already exists in the organization"
logger=plugins.external.registration t=2024-11-22T09:02:57.124588762Z level=error msg="Could not register an external service. Initialization skipped" pluginId=grafana-oncall-app error="[serviceaccounts.ErrTokenAlreadyExists] service account token with name extsvc-token-grafana-oncall-app already exists in the organization"
logger=plugins.initialization t=2024-11-22T09:02:57.124602983Z level=error msg="Could not initialize plugin" pluginId=grafana-oncall-app error="[serviceaccounts.ErrTokenAlreadyExists] service account token with name extsvc-token-grafana-oncall-app already exists in the organization"

Downgrading again does result in the same error.

grafana: Grafana v11.4.0-209360 (c63305a700) with ext service account feature flag active

feature_toggles:
accessControlOnCall: false enable: publicDashboards,publicDashboardsEmailSharing,lokiQuerySplitting,externalServiceAccounts,autoMigrateOldPanels,alertingCentralAlertHistory,grafanaManagedRecordingRules

How do we reproduce it?

  1. Open Grafana OnCall and upgrade oncall plugin
  2. Observe plugin gets disabled immediatly

Grafana OnCall Version

Grafana v11.4.0-209360

Product Area

Other

Grafana OnCall Platform?

Kubernetes

User's Browser?

No response

Anything else to add?

No response

bpedersen2 commented 2 days ago

I could resolve it by:

  1. uninstall oncall plugin
  2. set ( grafana.ini)
    [auth]
    managed_service_accounts_enabled = false
  3. restart grafana
  4. delete old service account
  5. set
    [auth]
    managed_service_accounts_enabled = true

    again

  6. restart grafana
  7. install plugin
  8. reconnect to oncall