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

Panic when excluding fluentd #871

Closed
lander2k2 opened this issue Oct 29, 2021 · 2 comments · Fixed by #872
Closed

Panic when excluding fluentd #871

lander2k2 opened this issue Oct 29, 2021 · 2 comments · Fixed by #872
Labels
bug Something isn't working

Comments

@lander2k2
Copy link
Contributor

Describe the bug:
When I submit a Logging resource with spec.fluentd omitted, the controller manger panics

Expected behaviour:
For the logging operator to deploy fluent-bit only.

Steps to reproduce the bug:

  1. remove the spec.fluentd block from a Logging manifest and create it.

Additional context:
none

Environment details:

  • Kubernetes version: v1.19.7
  • Cloud-provider/provisioner: AWS
  • logging-operator version: 3.15.0
  • Install method: Helm
  • Logs from the controller:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1b0 pc=0x15d2d31]

goroutine 525 [running]:
github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1.(*Logging).SetDefaults(0xc000d894a0, 0x1bea078, 0xc000853b90)
        /workspace/pkg/sdk/api/v1beta1/logging_types.go:295 +0x691
github.com/banzaicloud/logging-operator/controllers.(*LoggingReconciler).Reconcile(0xc0000becc0, 0x1bea078, 0xc000853b90, 0x0
, 0x0, 0xc000875ec0, 0xf, 0xc000853b90, 0xc000030000, 0x186b040, ...)
        /workspace/controllers/logging_controller.go:84 +0x245
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc00023d040, 0x1be9fd0, 0xc0002e3b80,
0x182b5a0, 0xc000bfe220)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:298 +0x30d
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc00023d040, 0x1be9fd0, 0xc0002e3b8
0, 0xc00092bf00)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2(0xc0004942d0, 0xc00023d040, 0x1be9fd0, 0xc
0002e3b80)
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214 +0x6b
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:210 +0x425
  • Resource definition (possibly in YAML format) that caused the issue, without sensitive data:
apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:
  name: bug-example
spec:
  controlNamespace: logging-system
  fluentbit: {}

/kind bug

@lander2k2
Copy link
Contributor Author

lander2k2 commented Oct 29, 2021

Also just noticed that when this panic is resolved, another emerges...

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1d4 pc=0x13b460c]

goroutine 542 [running]:
github.com/banzaicloud/logging-operator/pkg/resources/fluentbit.(*Reconciler).configSecret(0xc001330c00)
        /home/bruce/Projects/src/github.com/banzaicloud/logging-operator/pkg/resources/fluentbit/configsecret.go:166 +0x74c
github.com/banzaicloud/logging-operator/pkg/resources/fluentbit.(*Reconciler).Reconcile(0xc001330c00)
        /home/bruce/Projects/src/github.com/banzaicloud/logging-operator/pkg/resources/fluentbit/fluentbit.go:96 +0x3a9
github.com/banzaicloud/logging-operator/controllers.(*LoggingReconciler).Reconcile(0xc00019fb80, {0x1947318, 0xc000b56900}, {{{0x0, 0x0}, {0xc000a31bb0, 0xb}}})
        /home/bruce/Projects/src/github.com/banzaicloud/logging-operator/controllers/logging_controller.go:128 +0xc65
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002912c0, {0x1947270, 0xc0003b6b00}, {0x15b7fe0, 0xc00019e000})
        /home/bruce/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:298 +0x303
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002912c0, {0x1947270, 0xc0003b6b00})
        /home/bruce/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
        /home/bruce/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
        /home/bruce/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:210 +0x354
exit status 2

@lander2k2
Copy link
Contributor Author

New error was due to fluentd values being referenced for fluentbit's config secret. That has also been addressed in the linked PR.

@ahma ahma closed this as completed in #872 Nov 26, 2021
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.

1 participant