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

"log.SetLogger(...) was never called" warning in controller tests #2018

Closed
mdbooth opened this issue Apr 12, 2024 · 7 comments
Closed

"log.SetLogger(...) was never called" warning in controller tests #2018

mdbooth opened this issue Apr 12, 2024 · 7 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mdbooth
Copy link
Contributor

mdbooth commented Apr 12, 2024

/kind bug

We frequently (always?) see this scary warning in CI out of the -test job:

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
	>  goroutine 466 [running]:
	>  runtime/debug.Stack()
	>  	/usr/local/go/src/runtime/debug/stack.go:24 +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(0xc00028b780, {0x0, 0x0, 0x0})
	>  	/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:336
	>  sigs.k8s.io/controller-runtime/pkg/log.FromContext({0x2163438?, 0x327cfc0?}, {0x0?, 0x0?, 0x0?})
	>  	/root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:98 +0xf7
	>  sigs.k8s.io/cluster-api-provider-openstack/controllers.(*OpenStackClusterReconciler).Reconcile(0xc0008a25a0, {0x2163438, 0x327cfc0}, {{{0xc0006f10c0?, 0x0?}, {0xc0006f10b6?, 0x0?}}})
	>  	/home/prow/go/src/sigs.k8s.io/cluster-api-provider-openstack/controllers/openstackcluster_controller.go:75 +0xae
	>  sigs.k8s.io/cluster-api-provider-openstack/controllers.init.func1.4()
	>  	/home/prow/go/src/sigs.k8s.io/cluster-api-provider-openstack/controllers/openstackcluster_controller_test.go:178 +0x217
	>  github.com/onsi/ginkgo/v2/internal.extractBodyFunction.func3({0xc00057cfb0?, 0x91cee8?})
	>  	/root/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/node.go:463 +0x13
	>  github.com/onsi/ginkgo/v2/internal.(*Suite).runNode.func3()
	>  	/root/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/suite.go:889 +0x8d
	>  created by github.com/onsi/ginkgo/v2/internal.(*Suite).runNode in goroutine 6
	>  	/root/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/suite.go:876 +0xdb0
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 12, 2024
@kashifest
Copy link
Contributor

@mdbooth can I assign this to myself, I might have a working version here for capm3 metal3-io/cluster-api-provider-metal3#1658

@mdbooth
Copy link
Contributor Author

mdbooth commented May 15, 2024

@mdbooth can I assign this to myself, I might have a working version here for capm3 metal3-io/cluster-api-provider-metal3#1658

Be my guest! I was noodling something in #2019 but it didn't seem to work. I'll close it.

@kashifest
Copy link
Contributor

/assign

@EmilienM
Copy link
Contributor

Thanks @kashifest for your contributions, they are very appreciated!

@kashifest
Copy link
Contributor

Actually this should have been fixed already by #1754 , I think this is good to close, @EmilienM @mdbooth can you verify if this issue is still visible or not before we close this ?

@mdbooth
Copy link
Contributor Author

mdbooth commented May 17, 2024

Actually this should have been fixed already by #1754 , I think this is good to close, @EmilienM @mdbooth can you verify if this issue is still visible or not before we close this ?

I don't think so because the dates don't line up. That said, I can't reproduce this now and I don't see it in any recent CI output. Spooky 👻

I think I'll just close it. Sorry if you spent much time on this!

@mdbooth mdbooth closed this as completed May 17, 2024
@kashifest
Copy link
Contributor

No worries, it could be that you saw it in some release branch test where the fix was not cherry-picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants