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

[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed: #33

Open
zebesh opened this issue Mar 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zebesh
Copy link

zebesh commented Mar 13, 2024

What happened?

errors in logs

[controller-runtime] log.SetLogger(...) was never called, logs will not be displayed:
goroutine 3890 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x65
sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	sigs.k8s.io/[email protected]/pkg/log/log.go:59 +0xbd
sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithValues(0xc000950940, {0xc00090a0c0, 0x4, 0x4})
	sigs.k8s.io/[email protected]/pkg/log/deleg.go:168 +0x54
github.com/go-logr/logr.Logger.WithValues(...)
	github.com/go-logr/[email protected]/logr.go:323
sigs.k8s.io/controller-runtime/pkg/builder.(*Builder).doController.func1(0xc000d4ec20)
	sigs.k8s.io/[email protected]/pkg/builder/controller.go:400 +0x2b6
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000952000, {0x26bf640, 0xc000180370}, {0x204ed80?, 0xc000d4ebe0?})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:305 +0x18b
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000952000, {0x26bf640, 0xc000180370})
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265 +0x1d9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
	sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222 +0x587
@zebesh zebesh added the bug Something isn't working label Mar 13, 2024
@oliver-hofmann-cistec-com

it would be nice to have more informations exposed than just a stack trace that is not helping at all while debugging

@eric-carlsson
Copy link

eric-carlsson commented Aug 20, 2024

Encountered the same issue after updating the provider to v1.0.0. This seems to be caused by a breaking change to controller-runtime, see kubernetes-sigs/controller-runtime#2622. To fix this it seems we should pass a no-op logger explicitly.


@oliver-hofmann-cistec-com by updating the DeploymentRuntimeConfig to pass the --debug flag I can get relevant log output (such as error messages returned by the Vault API) .

apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: vault
spec:
  deploymentTemplate:
    spec:
      selector: {}
      template:
        ...
        spec:
          containers:
            - args: ["--debug"]

However, as mentioned by the code comment this produces extremely verbose output by controller-runtime. It would be nice to have an in-between option where we get errors messages returned by terraform without the rest of the debug information.

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

No branches or pull requests

3 participants