Uploaded image for project: 'Cluster Observability Operator'
  1. Cluster Observability Operator
  2. COO-1257

Controller panics with nil pointer dereference when ObservabilityInstaller has empty spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • cluster-observability
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description:{}

      Summary:{}

      The observability-operator controller crashes with a nil pointer dereference panic when an ObservabilityInstaller resource is created with an empty spec (spec: {}). The controller should handle empty specs gracefully and treat them as disabled capabilities.

      Steps to Reproduce:{}

        1. Create an ObservabilityInstaller with empty spec:

        apiVersion: observability.openshift.io/v1alpha1
        kind: ObservabilityInstaller
        metadata:
          name: test-empty-spec
          namespace: observability-operator
        spec: {}
      

        2. Apply the resource to the cluster

        3. Check the operator logs

      Expected Behavior:{}

        - Resource should be created successfully

        - Controller should handle empty spec gracefully

        - tracing.enabled should default to false

        - No operator components should be deployed

        - Controller should not panic

      Actual Behavior:{}

        - Resource is created successfully

        - Controller immediately panics with runtime error: invalid memory address or nil pointer dereference

        - Panic occurs at tempo_components.go:34 in the tempoStack() function

        - Controller enters infinite panic/recovery loop

        - Stack trace shows nil pointer access when trying to read instance.Spec.Capabilities.Tracing.Storage.ObjectStorageSpec

      Root Cause:{}

      The getReconcilers() function calls tempoStack(instance) without checking if instance.Spec.Capabilities is nil. When spec: {} is provided, Capabilities is nil, but the code assumes it's always present.

      Error Details:{}

      panic: runtime error: invalid memory address or nil pointer dereferenc at github.com/rhobs/observability-operator/pkg/controllers/observability.tempoStack(0xc000cb8420) /workspace/pkg/controllers/observability/tempo{}components.go:34 +0xd6{_}

              ploffay@redhat.com Pavol Loffay
              rhn-support-ikanse Ishwar Kanse
              None
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: