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

Observed panic deleting cluster which was still initialising #1654

Closed
mdbooth opened this issue Sep 6, 2023 · 1 comment · Fixed by #1657
Closed

Observed panic deleting cluster which was still initialising #1654

mdbooth opened this issue Sep 6, 2023 · 1 comment · Fixed by #1657
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mdbooth
Copy link
Contributor

mdbooth commented Sep 6, 2023

/kind bug

I0906 15:54:43.919368     607 controller.go:114] "Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference" controller="openstackmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackMachine" OpenStackMachine="default/mbooth-v1alpha6-md-0-s462m" namespace="default" name="mbooth-v1alpha6-md-0-s462m" reconcileID=e5573bc9-00ad-4385-8071-acd6c00596d1
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=0x10 pc=0x1684519]

goroutine 247 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:115 +0x1e5
panic({0x1811400?, 0x2a89d40?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
sigs.k8s.io/cluster-api-provider-openstack/controllers.machineToInstanceSpec(0xc000e2e000, 0xc000e28000, 0xc0005a5900, {0x0, 0x0})
	/home/mbooth/src/kubernetes-sigs/cluster-api-provider-openstack/issue1606_v2/controllers/openstackmachine_controller.go:498 +0x699
sigs.k8s.io/cluster-api-provider-openstack/controllers.(*OpenStackMachineReconciler).reconcileDelete(0x1cf7e48?, {0x1cf9d60, 0xc000d0e9c0}, 0xc000aba820, 0xc000e2e000, 0xc000e28000, 0xc0005a5900)
	/home/mbooth/src/kubernetes-sigs/cluster-api-provider-openstack/issue1606_v2/controllers/openstackmachine_controller.go:276 +0x5b8
sigs.k8s.io/cluster-api-provider-openstack/controllers.(*OpenStackMachineReconciler).Reconcile(0xc00004e960, {0x1cf5870, 0xc0008c9800}, {{{0xc000b1f630?, 0x0?}, {0xc000dc12a0?, 0x410725?}}})
	/home/mbooth/src/kubernetes-sigs/cluster-api-provider-openstack/issue1606_v2/controllers/openstackmachine_controller.go:150 +0xa5f
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1cf5870?, {0x1cf5870?, 0xc0008c9800?}, {{{0xc000b1f630?, 0x1753580?}, {0xc000dc12a0?, 0x1ce5978?}}})
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:118 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc00059e3c0, {0x1cf58a8, 0xc00001b090}, {0x189fee0?, 0xc000444920?})
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:314 +0x365
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc00059e3c0, {0x1cf58a8, 0xc00001b090})
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265 +0x1c9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 146
	/home/mbooth/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222 +0x565
Exiting with code 2

Looks like we're referencing security groups before they're created without checking:

if util.IsControlPlaneMachine(machine) {
managedSecurityGroup = openStackCluster.Status.ControlPlaneSecurityGroup.ID
} else {
managedSecurityGroup = openStackCluster.Status.WorkerSecurityGroup.ID
}

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 6, 2023
@mdbooth
Copy link
Contributor Author

mdbooth commented Sep 6, 2023

This might be a regression introduced by #1648.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants