Skip to content

Not able to provision DataSourceConfigLbacRules #262

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

Open
Miguel-Barros96 opened this issue Mar 20, 2025 · 2 comments
Open

Not able to provision DataSourceConfigLbacRules #262

Miguel-Barros96 opened this issue Mar 20, 2025 · 2 comments

Comments

@Miguel-Barros96
Copy link

Crossplane Version

1.19.0

Crossplane Grafana Provider Version

0.26.0

Affected Resource(s)

  • enterprise.grafana.crossplane.io/v1alpha1/DataSourceConfigLbacRules

YAML resources

apiVersion: enterprise.grafana.crossplane.io/v1alpha1
kind: DataSourceConfigLbacRules
metadata:
  name: global-loki-logs
spec:
  forProvider:
    datasourceUid: <datasourceUid> # hidden for github Issue
    rules: |
      {
        "fdnd1pf4m9sxvc" :[
          "{ service_name=\"bigquery-sync-mysql\" }"
        ]
      }
  providerConfigRef:
    name: grafana-provider

Expected Behavior

LBAC added to loki datasources

Actual Behavior

Grafana provider crashed with the following error:

"level":"info","ts":"2025-03-20T02:12:59Z","logger":"provider-grafana","msg":"Starting workers","controller":"managed/cloud.grafana.crossplane.io/v1alpha1, kind=orgmember","worker count":100}
2025/03/20 02:12:59 [DEBUG] POST https://grafana.com/api/v1/accesspolicies/1f8657ef-6c00-4221-a74d-39fe4ebf387c?region=prod-eu-west-2
2025/03/20 02:12:59 [DEBUG] DELETE https://grafana.com/api/v1/tokens/338d8871-e844-484b-9ea6-91295bea1f89?region=prod-eu-west-2
2025/03/20 02:12:59 [DEBUG] POST https://grafana.com/api/v1/tokens?region=
2025/03/20 02:12:59 [DEBUG] GET https://grafana.com/api/v1/accesspolicies/1f8657ef-6c00-4221-a74d-39fe4ebf387c?region=prod-eu-west-2
E0320 02:13:00.314407       1 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 1560 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2b82b60, 0x5429160})
	k8s.io/[email protected]/pkg/util/runtime/runtime.go:75 +0x85
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:103 +0xb2
panic({0x2b82b60?, 0x5429160?})
	runtime/panic.go:791 +0x132
github.com/crossplane/upjet/pkg/controller.(*TerraformPluginFrameworkConnector).configureProvider(0x3696260?, {0x367c640, 0xc00463ab60}, {{0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, ...}}, ...})
	github.com/crossplane/[email protected]/pkg/controller/external_tfpluginfw.go:206 +0x4e
github.com/crossplane/upjet/pkg/controller.(*TerraformPluginFrameworkConnector).Connect(0xc000efe320, {0x367c640, 0xc00463ab60}, {0x36b8f10, 0xc000eb51e0})
	github.com/crossplane/[email protected]/pkg/controller/external_tfpluginfw.go:167 +0xdb4
github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*NopDisconnecter).Connect(0xc000c979f0?, {0x367c640?, 0xc00463ab60?}, {0x36b8f10?, 0xc000eb51e0?})
	github.com/crossplane/[email protected]/pkg/reconciler/managed/reconciler.go:256 +0x2f
github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile(0xc000e9f200, {0x367c598, 0xc003337980}, {{{0x0, 0x0}, {0xc000151b80, 0x19}}})
	github.com/crossplane/[email protected]/pkg/reconciler/managed/reconciler.go:946 +0x1e2b
github.com/crossplane/crossplane-runtime/pkg/ratelimiter.(*Reconciler).Reconcile(0xc000efe3c0, {0x367c598, 0xc003337980}, {{{0x0?, 0x5?}, {0xc000151b80?, 0xc003895d10?}}})
	github.com/crossplane/[email protected]/pkg/ratelimiter/reconciler.go:54 +0x151
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x3685e00?, {0x367c598?, 0xc003337980?}, {{{0x0?, 0xb?}, {0xc000151b80?, 0x0?}}})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114 +0xa5
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0008c8d10, {0x367c5d0, 0xc000e8acd0}, {0x2cdc000, 0xc005585d20})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311 +0x39c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0008c8d10, {0x367c5d0, 0xc000e8acd0})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261 +0x19d
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222 +0x73
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 103
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218 +0x46c
{"level":"error","ts":"2025-03-20T02:13:00Z","logger":"provider-grafana","msg":"Reconciler error","controller":"managed/enterprise.grafana.crossplane.io/v1alpha1, kind=datasourceconfiglbacrules","namespace":"","name":"global-loki-logs","reconcileID":"ab0d7644-5880-472a-9860-457061a1dea0","error":"panic: runtime error: invalid memory address or nil pointer dereference [recovered]","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:324
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222"}

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@Duologic
Copy link
Member

I'm not entirely sure whether this is due to the resource, the error looks quite low level.

Do you also use the same ProviderConfig to deploy other resources? Can you show the structure of the Secret used by ProviderConfig/grafana-provider? I've seen a similar error where that was the problem.

@Miguel-Barros96
Copy link
Author

Hello @Duologic, I am using the provider to create multiple resources (folders, teams, datasources, etc) it's just failing in the LBAC rules resource.

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

No branches or pull requests

2 participants