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

[OCP 4.10] machine-config-daemon: invalid memory address or nil pointer dereference

XMLWordPrintable

      Description of problem:

      This issue is triggered by the lack of the file "/etc/kubernetes/kubeconfig" in the node, but what i found interesting is the aesthetic error that follows:
      
      2023-01-04T10:56:50.807982171Z I0104 10:56:50.807918   18013 start.go:112] Version: v4.11.0-202212070335.p0.g60746a8.assembly.stream-dirty (60746a843e7ef8855ae00f2ffcb655c53e0e8296)
      2023-01-04T10:56:50.810326376Z I0104 10:56:50.810190   18013 start.go:125] Calling chroot("/rootfs")
      2023-01-04T10:56:50.810326376Z I0104 10:56:50.810274   18013 update.go:1972] Running: systemctl start rpm-ostreed
      2023-01-04T10:56:50.855151883Z I0104 10:56:50.854666   18013 rpm-ostree.go:353] Running captured: rpm-ostree status --json
      2023-01-04T10:56:50.899635929Z I0104 10:56:50.899574   18013 rpm-ostree.go:353] Running captured: rpm-ostree status --json
      2023-01-04T10:56:50.941236704Z I0104 10:56:50.941179   18013 daemon.go:236] Booted osImageURL: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:318187717bd19ef265000570d5580ea680dfbe99c3bece6dd180537a6f268f
      e1 (410.84.202210061459-0)
      2023-01-04T10:56:50.973206073Z I0104 10:56:50.973131   18013 start.go:101] Copied self to /run/bin/machine-config-daemon on host
      2023-01-04T10:56:50.973259966Z E0104 10:56:50.973196   18013 start.go:177] failed to load kubelet kubeconfig: open /etc/kubernetes/kubeconfig: no such file or directory
      2023-01-04T10:56:50.975399571Z panic: runtime error: invalid memory address or nil pointer dereference
      2023-01-04T10:56:50.975399571Z [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x173d84f]
      2023-01-04T10:56:50.975399571Z
      2023-01-04T10:56:50.975399571Z goroutine 1 [running]:
      2023-01-04T10:56:50.975399571Z main.runStartCmd(2023-01-04T10:56:50.975436752Z 0x2c3da80?, {0x1bc0b3b?, 0x0?, 0x0?})
      2023-01-04T10:56:50.975436752Z  /go/src/github.com/openshift/machine-config-operator/cmd/machine-config-daemon/start.go:179 +0x70f
      2023-01-04T10:56:50.975436752Z github.com/spf13/cobra.(*Command).execute(0x2c3da80, {0x2c89310, 0x0, 0x0})
      2023-01-04T10:56:50.975436752Z  /go/src/github.com/openshift/machine-config-operator/vendor/github.com/spf13/cobra/command.go:860 +0x663
      2023-01-04T10:56:50.975448580Z github.com/spf13/cobra.(*Command).ExecuteC(0x2c3d580)
      2023-01-04T10:56:50.975448580Z  /go/src/github.com/openshift/machine-config-operator/vendor/github.com/spf13/cobra/command.go:974 +0x3b4
      2023-01-04T10:56:50.975456464Z github.com/spf13/cobra.(*Command).Execute(...)
      2023-01-04T10:56:50.975456464Z  2023-01-04T10:56:50.975464649Z /go/src/github.com/openshift/machine-config-operator/vendor/github.com/spf13/cobra/command.go:902
      2023-01-04T10:56:50.975464649Z k8s.io/component-base/cli.Run(2023-01-04T10:56:50.975472575Z 0x2c3d580)
      2023-01-04T10:56:50.975472575Z  /go/src/github.com/openshift/machine-config-operator/vendor/k8s.io/component-base/cli/run.go:105 +0x385
      2023-01-04T10:56:50.975485076Z main.main()
      2023-01-04T10:56:50.975485076Z  /go/src/github.com/openshift/machine-config-operator/cmd/machine-config-daemon/main.go:28 +0x25
      

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

      4.11.20

      How reproducible:

      Always

      Steps to Reproduce:

      1. Remove / change the name of the file "/etc/kubernetes/kubeconfig"
      2. Delete machine-config-daemon pod
      3. 
      

      Actual results:

      2023-01-04T10:56:50.973259966Z E0104 10:56:50.973196   18013 start.go:177] failed to load kubelet kubeconfig: open /etc/kubernetes/kubeconfig: no such file or directory
      2023-01-04T10:56:50.975399571Z panic: runtime error: invalid memory address or nil pointer dereference

      Expected results:

      Fatal error
       
       failed to load kubelet kubeconfig: open /etc/kubernetes/kubeconfig: no such file or directory
      
      but no runtime error

      Additional info:

      https://github.com/openshift/machine-config-operator/blob/92012a837e2ed0ed3c9e61c715579ac82ad0a464/cmd/machine-config-daemon/start.go#L179

              dkhater@redhat.com Dalia Khater
              rhn-support-mabajodu Mario Abajo Duran
              Rio Liu Rio Liu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: