controller-runtime icon indicating copy to clipboard operation
controller-runtime copied to clipboard

error with logs will not be displayed

Open geraldstanje1 opened this issue 10 months ago • 7 comments

hi,

is the following a known issue? please advise how to fix it?

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
	>  goroutine 216 [running]:
	>  runtime/debug.Stack()
	>  	/usr/local/go/src/runtime/debug/stack.go:26 +0x5e
	>  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:60 +0xcd
	>  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0xc000d27a80, {0xc001327e20, 0x2, 0x2})
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:168 +0x49
	>  github.com/go-logr/logr.Logger.WithValues(...)
	>  	/root/go/pkg/mod/github.com/go-logr/[email protected]/logr.go:332
	>  sigs.k8s.io/controller-runtime/pkg/builder.(*TypedBuilder[...]).doController.func1()
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/builder/controller.go:449 +0x1b3
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler(0x59807a0, {0x5957e70, 0xc000e587d0}, {{{0xc0017a9bc0, 0x11}, {0xc0017a9cc8, 0x12}}})
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:293 +0x13c
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem(0x59807a0, {0x5957e70, 0xc000e587d0})
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:263 +0x20e
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2()
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:224 +0x85
	>  created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2 in goroutine 38
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:220 +0x490

geraldstanje1 avatar Jun 25 '25 21:06 geraldstanje1

Call log.SetLogger(...)

sbueringer avatar Jun 26 '25 06:06 sbueringer

@sbueringer where to call log.SetLogger(...) - in controller-runtime?

geraldstanje1 avatar Jun 26 '25 13:06 geraldstanje1

Here is an example: https://github.com/kubernetes-sigs/controller-runtime/blob/2add01e784f9f75a8f1be38fc0a21eee5eaee84f/examples/builtins/main.go#L37

sbueringer avatar Jun 26 '25 14:06 sbueringer

@sbueringer do you mean there is an issue in the controller-runtime code in sigs.k8s.io/controller-runtime/pkg?

geraldstanje1 avatar Jun 26 '25 14:06 geraldstanje1

No. I linked you example code how you can call log.SetLogger in your code

sbueringer avatar Jun 26 '25 14:06 sbueringer

but the error comes from the library - do you see?

geraldstanje1 avatar Jun 26 '25 15:06 geraldstanje1

Yes it comes from controller-runtime to tell you that you have to call SetLogger.

That does not mean that there is an issue/bug in controller-runtime

sbueringer avatar Jun 26 '25 16:06 sbueringer

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 24 '25 16:09 k8s-triage-robot

/close

See comment above

sbueringer avatar Sep 24 '25 17:09 sbueringer

@sbueringer: Closing this issue.

In response to this:

/close

See comment above

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 24 '25 17:09 k8s-ci-robot