crossplane-contrib / provider-kafka

Crossplane provider for Kafka
Apache License 2.0
30 stars 32 forks source link

Runtime error `log.SetLogger(...) was never called` in the crossplane-provider-kafka-94381af0b190 pod #69

Open katikireddy622 opened 5 months ago

katikireddy622 commented 5 months ago

What happened?

We have rolled out crossplane-provider-kafka version to v0.5.0 two weeks ago and then we have upgraded the kubernetes version from v1.26 to v1.27 and the provider is still working after the upgrade. after few days we are getting errors from the crossplane-provider-kafka pod.

What environment did it happen in?

Crossplane version: v1.15.1 Kubernetes version: v1.27.12-eks-adc7111 kafka provider : xpkg.upbound.io/crossplane-contrib/provider-kafka:v0.5.0

Provider Logs

kubectl logs crossplane-provider-kafka-94381af0b190-c5c7fbc94-zhs5m

`[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed. Detected at:

goroutine 161 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x5e sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot() sigs.k8s.io/controller-runtime@v0.16.3/pkg/log/log.go:60 +0xcd sigs.k8s.io/controller-runtime/pkg/log.(delegatingLogSink).WithValues(0xc00005f300, {0xc004677740, 0x2, 0x2}) sigs.k8s.io/controller-runtime@v0.16.3/pkg/log/deleg.go:168 +0x49 github.com/go-logr/logr.Logger.WithValues(...) github.com/go-logr/logr@v1.2.4/logr.go:323 sigs.k8s.io/controller-runtime/pkg/builder.(Builder).doController.func1(0xc004677720) sigs.k8s.io/controller-runtime@v0.16.3/pkg/builder/controller.go:400 +0x173 sigs.k8s.io/controller-runtime/pkg/internal/controller.(Controller).reconcileHandler(0xc000444f00, {0x20dbbc8, 0xc00043a410}, {0x1a4ad00?, 0xc000050e00?}) sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:306 +0x16a sigs.k8s.io/controller-runtime/pkg/internal/controller.(Controller).processNextWorkItem(0xc000444f00, {0x20dbbc8, 0xc00043a410}) sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:266 +0x1c9 sigs.k8s.io/controller-runtime/pkg/internal/controller.(Controller).Start.func2.2() sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:227 +0x79 created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(Controller).Start.func2 in goroutine 30 sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:223 +0x565`

jutley commented 5 months ago

I just ran into this upgrading from 0.4.3 to 0.5.0.

Upon further investigation, I'm not sure if this is a problem, though it certainly looks like one! I have gotten into Crossplane operations in a while, but I recall the "logging" is mostly happening through k8s Events and not actual logs.

This snippet shows that this log is intentionally not provided any logger.

https://github.com/crossplane-contrib/provider-kafka/blob/6bfe34ee4348711de1ad7ed589629092ecb0b1a8/cmd/provider/main.go#L53-L58