Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-4621

Crash in compliance operator at compliance-operator/pkg/utils.AreKubeletConfigsRendered

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • 4.11.z, 4.11
    • Compliance Operator
    • None
    • ?
    • None
    • 2
    • CMP Sprint 57, CMP Sprint 58
    • 2
    • False
    • Hide

      None

      Show
      None
    • Hide
      Cause: The compliance operator didn't check for empty kubelet configuration when parsing machine configuration.

      Consequence: The compliance operator would panic and crash because it assumed the structure of the configuration was always present. This might not be the case if it's supplied incorrectly by the user or content writer.

      Fix: Upgrade the compliance operator.

      Result: The latest version of the compliance operator implements improved checking of the kubelet configuration data structure and only continues if it's fully rendered.
      Show
      Cause: The compliance operator didn't check for empty kubelet configuration when parsing machine configuration. Consequence: The compliance operator would panic and crash because it assumed the structure of the configuration was always present. This might not be the case if it's supplied incorrectly by the user or content writer. Fix: Upgrade the compliance operator. Result: The latest version of the compliance operator implements improved checking of the kubelet configuration data structure and only continues if it's fully rendered.
    • Bug Fix

      Description of problem:

      Compliance operator crashing with this stacktrace:

      {"level":"info","ts":"2022-11-30T17:21:52.317Z","msg":"Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference","controller":"compliancesuite-controller","object":

      {"name":"mss","namespace":"openshift-compliance"}

      ,"namespace":"openshift-compliance","name":"mss","reconcileID":"fc5b04eb-db7c-428c-aa98-337599907d64"}
      panic: runtime error: invalid memory address or nil pointer dereference [recovered]
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1655d84]

      goroutine 1284 [running]:
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:118 +0x1f4
      panic(

      {0x1e50d60, 0x3749d20}

      )
      runtime/panic.go:1038 +0x215
      github.com/ComplianceAsCode/compliance-operator/pkg/utils.IsKCSubsetOfMC(0xc008c5e420, 0xc000aa2000)
      github.com/ComplianceAsCode/compliance-operator/pkg/utils/nodeutils.go:217 +0x444
      github.com/ComplianceAsCode/compliance-operator/pkg/utils.AreKubeletConfigsRendered(0xc008dd7b80,

      {0x24d8ac0, 0xc0000c2af0}

      )
      github.com/ComplianceAsCode/compliance-operator/pkg/utils/nodeutils.go:165 +0x239
      github.com/ComplianceAsCode/compliance-operator/pkg/controller/compliancesuite.(*ReconcileComplianceSuite).reconcileRemediations(0xc0006ba3c0, 0xc00053ea80, {{0x24be280, 0xc00732f320}, 0xa})
      github.com/ComplianceAsCode/compliance-operator/pkg/controller/compliancesuite/compliancesuite_controller.go:528 +0x70a
      github.com/ComplianceAsCode/compliance-operator/pkg/controller/compliancesuite.(*ReconcileComplianceSuite).Reconcile(0xc0006ba3c0,

      {0xc000101000, 0xc00732f2f0}

      , {{

      {0xc000711590, 0x18}

      ,

      {0xc000b612a0, 0x413707}

      }})
      github.com/ComplianceAsCode/compliance-operator/pkg/controller/compliancesuite/compliancesuite_controller.go:188 +0x625
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x249fda8,

      {0x249fe50, 0xc00732f2f0}

      , {{

      {0xc000711590, 0x2013760}

      ,

      {0xc000b612a0, 0x41517d}

      }})
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:121 +0xd1
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0001eb360,

      {0x249fda8, 0xc0008f4f40}, {0x1eec5e0, 0xc000523440})
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:320 +0x33c
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0001eb360, {0x249fda8, 0xc0008f4f40}

      )
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:273 +0x205
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:234 +0x85
      created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
      sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:230 +0x36f

      Version-Release number of selected component (if applicable): v0.157

      I will add information as about kubeletconfig / machineconfigs as soon as possible.

        1. kubeletconfig.yaml
          1 kB
        2. mc.yaml
          7.33 MB

            wenshen@redhat.com Vincent Shen
            rhn-support-gparente German Parente
            Xiaojie Yuan Xiaojie Yuan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: