Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Missing BMH fields cause panic #6

Open
drewwalters96 opened this issue Nov 30, 2020 · 4 comments
Open

Missing BMH fields cause panic #6

drewwalters96 opened this issue Nov 30, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@drewwalters96
Copy link
Collaborator

drewwalters96 commented Nov 30, 2020

SIP requires some BMH fields, including Spec.NetworkData.Namespace and Spec.NetworkData.Name. When BMHs are pushed to K8s without these fields, SIP panics.

@alexander-hughes
Copy link
Contributor

/assign

@drewwalters96 drewwalters96 added the bug Something isn't working label Dec 3, 2020
@alexander-hughes
Copy link
Contributor

Still working on this, had some difficulty last week reproducing the error. Several possible attempts to resolve have failed, including removing the check from pkg/vbmh/machines.go Extrapolate function:

		//// Skip if I alread extrapolated tehh data for this machine
		//if len(machine.Data.IpOnInterface) > 0 {
		//	continue
		//}

The particular error we're seeing is when a vbmh is missing the networkData.Name or networkData.Namespace fields. To reproduce this error:

  1. Stand up development environment as described in https://github.com/att-comdev/sip/blob/master/README.md
  2. Comment out all of the networkData fields in config/samples/bmh/bmh.yaml
  3. kustomize build config/samples | kubectl apply -f -
  4. This will put the sip controller into a crashloop. With log entries like the following (from the manager container):
2020-12-07T14:03:38.722Z        INFO    controllers.SIPCluster.machines Found machines for scheduling   {"SIPCluster": "sipcluster-system/sipcluster-test1", "count": 5}
Schedule.Extrapolate.getIp machine.Data.IpOnInterface[oam-ipv4]:32.68.51.140
Schedule.Extrapolate  machine.Data.IpOnInterface len:0 machine:Machine {
        Bmh:rdm9r007o001
        ScheduleStatus:Selected
        VmRole:master
E1207 14:03:38.824246       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 212 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x1540960, 0x24568b0)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:74 +0xa3
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:48 +0x82
panic(0x1540960, 0x24568b0)
        /usr/local/go/src/runtime/panic.go:679 +0x1b2
sipcluster/pkg/vbmh.(*MachineList).Extrapolate(0xc0004145c0, 0x1414316, 0xa, 0xc0000d8660, 0x18, 0xc000321c00, 0x10, 0x0, 0x0, 0xc00028a780, ...)
        /workspace/pkg/vbmh/machines.go:396 +0x29a
sipcluster/pkg/controllers.(*SIPClusterReconciler).gatherVBMH(0xc0004314a0, 0x1414316, 0xa, 0xc0000d8660, 0x18, 0xc000321c00, 0x10, 0x0, 0x0, 0xc00028a780, ...)
        /workspace/pkg/controllers/sipcluster_controller.go:183 +0x380
sipcluster/pkg/controllers.(*SIPClusterReconciler).Reconcile(0xc0004314a0, 0xc00028a780, 0x11, 0xc000321c00, 0x10, 0xc000306280, 0xc00020e2d8, 0x1912200, 0xc00020e2d0)
        /workspace/pkg/controllers/sipcluster_controller.go:68 +0x2b9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0004ecf30, 0x1597a60, 0xc000226540, 0x43e600)
        /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:244 +0x27d
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0004ecf30, 0x0)
        /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218 +0xcb
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker(0xc0004ecf30)
        /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:197 +0x2b
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc000306240)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155 +0x5e
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc000306240, 0x1903cc0, 0xc000367ec0, 0x1, 0xc0004e83c0)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156 +0xa3
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000306240, 0x3b9aca00, 0x0, 0x1, 0xc0004e83c0)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133 +0xaa
k8s.io/apimachinery/pkg/util/wait.Until(0xc000306240, 0x3b9aca00, 0xc0004e83c0)
        /root/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:90 +0x4d
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
        /root/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:179 +0x44d
}

@alexander-hughes
Copy link
Contributor

Work in progress, tracked in #22

@alexander-hughes
Copy link
Contributor

PR #22 abandoned, but #23 was merged resolving this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants