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. #353

Open
glennpratt opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@glennpratt
Copy link
Contributor

glennpratt commented Jul 24, 2024

What happened?

It appears this is intentional, but I don't think it triggering a stack trace is intentional. Perhaps it could be accomplished a different way.

if *debug {
// The controller-runtime runs with a no-op logger by default. It is
// *very* verbose even at info level, so we only provide it a real
// logger when we're running in debug mode.
ctrl.SetLogger(zl)
}

https://github.com/kubernetes-sigs/controller-runtime/blob/1ed345090869edc4bd94fe220386cb7fa5df745f/pkg/log/log.go#L65-L67

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.                                                                                                                                                              
Detected at:                                                                                                                                                                                                                                       
    >  goroutine 122 [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).Enabled(0xc0000b6f80, 0xa400000000000000?)                                                                                                                                      
    >      sigs.k8s.io/[email protected]/pkg/log/deleg.go:111 +0x32                                                                                                                                                                       
    >  github.com/go-logr/logr.Logger.Info({{0x1b98f28?, 0xc0000b6f80?}, 0xc00014d000?}, {0xc00014d000, 0xa3}, {0x0, 0x0, 0x0})                                                                                                                    
    >      github.com/go-logr/[email protected]/logr.go:276 +0x72                                                                                                                                                                                        
    >  sigs.k8s.io/controller-runtime/pkg/log.(*KubeAPIWarningLogger).HandleWarningHeader(0xc0004a46f0?, 0x1?, {0x190f677?, 0x7?}, {0xc00014d000?, 0xa3?})                                                                                         
    >      sigs.k8s.io/[email protected]/pkg/log/warning_handler.go:65 +0x167                                                                                                                                                             
    >  k8s.io/client-go/rest.handleWarnings(0xc00043ec90?, {0x1b7cde0?, 0xc0004a46f0?})                                                                                                                                                            
    >      k8s.io/[email protected]/rest/warnings.go:144 +0xef                                                                                                                                                                                     
    >  k8s.io/client-go/rest.(*Request).transformResponse(0xc0004f05a0, 0xc00061e510, 0xc0005f6500)                                                                                                                                                
    >      k8s.io/[email protected]/rest/request.go:1179 +0x5c8                                                                                                                                                                                    
    >  k8s.io/client-go/rest.(*Request).Do.func1(0xc0004369c0?, 0x0?)                                                                                                                                                                              
    >      k8s.io/[email protected]/rest/request.go:1064 +0x31                                                                                                                                                                                     
    >  k8s.io/client-go/rest.(*Request).request.func3.1(...)                                                                                                                                                                                       
    >      k8s.io/[email protected]/rest/request.go:1039                                                                                                                                                                                           
    >  k8s.io/client-go/rest.(*Request).request.func3(0xc00061e510, 0xc0007e22f0, {0x1b96200?, 0xc0004369c0?}, 0x0?, 0x0?, 0xc000324c60?, {0x0?, 0x0?}, 0x1a085f0)                                                                                 
    >      k8s.io/[email protected]/rest/request.go:1046 +0xd7                                                                                                                                                                                     
    >  k8s.io/client-go/rest.(*Request).request(0xc0004f05a0, {0x1b96078, 0xc000216310}, 0x8?)                                                                                                                                                     
    >      k8s.io/[email protected]/rest/request.go:1048 +0x4ed                                                                                                                                                                                    
    >  k8s.io/client-go/rest.(*Request).Do(0xc0004f05a0, {0x1b96078, 0xc000216310})                                                                                                                                                                
    >      k8s.io/[email protected]/rest/request.go:1063 +0xb0                                                                                                                                                                                     
    >  sigs.k8s.io/controller-runtime/pkg/client.(*typedClient).Update(0xc0000c86c0, {0x1b96078, 0xc000216310}, {0x1ba8768?, 0xc00078c1e0}, {0x0, 0x0, 0xc0007e2578?})                                                                             
    >      sigs.k8s.io/[email protected]/pkg/client/typed_client.go:68 +0x37a                                                                                                                                                             
    >  sigs.k8s.io/controller-runtime/pkg/client.(*client).Update(0xc0000c86c0, {0x1b96078, 0xc000216310}, {0x1ba8768?, 0xc00078c1e0}, {0x0, 0x0, 0x0})                                                                                            
    >      sigs.k8s.io/[email protected]/pkg/client/client.go:309 +0x275                                                                                                                                                                  
    >  github.com/crossplane/crossplane-runtime/pkg/resource.(*APIFinalizer).AddFinalizer(0xc00048fa20, {0x1b96078, 0xc000216310}, {0x7fc2049f6880?, 0xc00078c1e0})                                                                                
    >      github.com/crossplane/[email protected]/pkg/resource/api.go:165 +0x16a                                                                                                                                                         
    >  github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile(0xc00026f590, {0x1b95fd0, 0xc0005ea990}, {{{0x0, 0x0}, {0xc00048b4e0, 0x1e}}})                                                                      
    >      github.com/crossplane/[email protected]/pkg/reconciler/managed/reconciler.go:1015 +0x49c9                                                                                                                                      
    >  github.com/crossplane/crossplane-runtime/pkg/ratelimiter.(*Reconciler).Reconcile(0xc0004a6190, {0x1b95fd0, 0xc0005ea990}, {{{0x0?, 0xc0000b6340?}, {0xc00048b4e0?, 0xc0007e3d08?}}})                                                        
    >      github.com/crossplane/[email protected]/pkg/ratelimiter/reconciler.go:54 +0x151                                                                                                                                                
    >  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1b98f28?, {0x1b95fd0?, 0xc0005ea990?}, {{{0x0?, 0xb?}, {0xc00048b4e0?, 0x0?}}})                                                                            
    >      sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0xb7                                                                                                                                                  
    >  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000151900, {0x1b96008, 0xc00048d900}, {0x1783a20?, 0xc000438420?})                                                                                 
    >      sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316 +0x3cc                                                                                                                                                 
    >  sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000151900, {0x1b96008, 0xc00048d900})                                                                                                           
    >      sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x1af                                                                                                                                                 
    >  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 25                                                                                                                                 
    >      sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x565

How can we reproduce it?

Review the logs after at least 30 seconds and perhaps after one AnsibleRun executes.

What environment did it happen in?

Crossplane version:

crossplane:v1.16.0
provider-ansible:v0.6.0

  • Cloud provider or hardware configuration
  • Kubernetes version (use kubectl version)
    Server Version: v1.29.2+rke2r1
  • Kubernetes distribution (e.g. Tectonic, GKE, OpenShift)
    RKE2
  • OS (e.g. from /etc/os-release)
    Ubuntu 22.04.4 LTS
  • Kernel (e.g. uname -a)
    Linux provider-ansible-a82fde579a6a-6d8965c84c-hqbn6 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 Linux
@glennpratt glennpratt added the bug Something isn't working label Jul 24, 2024
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

1 participant