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

No logs in Pod - [controller-runtime] log.SetLogger(...) was never called; logs will not be displayed. #150

Closed
bakito opened this issue Jul 12, 2024 · 4 comments · Fixed by #151
Labels
bug Something isn't working

Comments

@bakito
Copy link

bakito commented Jul 12, 2024

What happened?

The Pod started for the gitlab provider v0.8.0 des not show anly log besides the following:

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
	>  goroutine 382 [running]:
	>  runtime/debug.Stack()
	>  	runtime/debug/stack.go:24 +0x5e
	>  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	>  	sigs.k8s.io/[email protected]/pkg/log/log.go:60 +0xcd
	>  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0xc000132bc0, {0xc000098400, 0x2, 0x2})
	>  	sigs.k8s.io/[email protected]/pkg/log/deleg.go:168 +0x49
	>  github.com/go-logr/logr.Logger.WithValues(...)
	>  	github.com/go-logr/[email protected]/logr.go:332
	>  sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).doController.func1(0xc0000983e0)
	>  	sigs.k8s.io/[email protected]/pkg/builder/controller.go:400 +0x193
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0000bc820, {0x1ebf350, 0xc0004aa6e0}, {0x1a13820, 0xc0000983c0})
	>  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:306 +0x162
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0000bc820, {0x1ebf350, 0xc0004aa6e0})
	>  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x1be
	>  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	>  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 +0x79
	>  created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 48
	>  	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x50c

How can we reproduce it?

Install the gitlab provider and check the log of the started pod.

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-gitlab
spec:
  package: xpkg.upbound.io/crossplane-contrib/provider-gitlab:v0.8.0

What environment did it happen in?

Crossplane version: v1.16.0
Crossplane Provider GitLab version: v0.8.0
Kubernetes version: v1.29.5

@bakito bakito added the bug Something isn't working label Jul 12, 2024
@lacroi-m-insta
Copy link
Contributor

It seams to go away when setting the debug flag (it can be set in the DeploymentRuntimeConfig spec.containers.args: [-d])

@bakito
Copy link
Author

bakito commented Jul 15, 2024

true, the error disappears as in debug mode, a logger is set.
https://github.com/crossplane-contrib/provider-gitlab/blob/master/cmd/provider/main.go#L67

To truly fix it, a logger needs to be set always.

@ma-ble
Copy link

ma-ble commented Jul 18, 2024

In Crossplane and its providers everything works with events instead of logs because most users will not have access to the pod logs.

https://github.com/crossplane/crossplane/blob/fc418390/docs/contributing/observability_developer_guide.md

@bakito
Copy link
Author

bakito commented Jul 18, 2024

Still there should not be an error stack trace in the pod log for those users with access to the logs if the provider works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants