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

[BUG] KubeBlocks reports 'deleting the sub-resource kinds: []' but the cluster won't be deleted. #8104

Closed
kissycn opened this issue Sep 6, 2024 · 4 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@kissycn
Copy link
Contributor

kissycn commented Sep 6, 2024

Describe the bug
When I delete a cluster, it always gets stuck at Deleting. Then I check the logs and find:

 ERROR delete *v1alpha1.InstanceSet error: apecloud-mysql {"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "InstanceSet": {"name":"apecloud-mysql","namespace":"default"}, "namespace": "default", "name": "apecloud-mysql", "reconcileID": "e766218c-9f5c-45da-a2d2-6985bda7cda6", "InstanceSet": {"name":"apecloud-mysql","namespace":"default"}, "error": "Operation cannot be fulfilled on instancesets.workloads.kubeblocks.io \"apecloud-mysql\": StorageError: invalid object, Code: 4, Key: /registry/workloads.kubeblocks.io/instancesets/default/apecloud-mysql, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: c0d8bdd3-febb-4fb4-b9d8-9a3bdbe130bc, UID in object meta: "}

To Reproduce
Steps to reproduce the behavior:

  1. kbcli cluster create apecloud --cluster-definition apecloud-mysql
  2. k get pods
NAME               READY   STATUS    RESTARTS   AGE
apecloud-mysql-2   4/4     Running   0          91s
apecloud-mysql-1   4/4     Running   0          91s
apecloud-mysql-0   4/4     Running   0          91s
  1. kbcli cluster delete apecloud
  2. k -n kb-system logs kubeblocks-659f75d556-qbxs8 -f
ERROR	delete *v1.Pod error: apecloud-mysql-0	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "InstanceSet": {"name":"apecloud-mysql","namespace":"default"}, "namespace": "default", "name": "apecloud-mysql", "reconcileID": "17c1f7c8-63dc-44b9-afed-89d5bb4ec46c", "InstanceSet": {"name":"apecloud-mysql","namespace":"default"}, "error": "Operation cannot be fulfilled on pods \"apecloud-mysql-0\": StorageError: invalid object, Code: 4, Key: /registry/pods/default/apecloud-mysql-0, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 69298963-042b-4fef-91ca-e75f02b74e6f, UID in object meta: "}
github.com/apecloud/kubeblocks/pkg/controller/kubebuilderx.(*PlanBuilder).deleteObject
	/src/pkg/controller/kubebuilderx/plan_builder.go:280
github.com/apecloud/kubeblocks/pkg/controller/kubebuilderx.(*PlanBuilder).defaultWalkFunc
	/src/pkg/controller/kubebuilderx/plan_builder.go:240
github.com/apecloud/kubeblocks/pkg/controller/kubebuilderx.(*Plan).Execute
	/src/pkg/controller/kubebuilderx/plan_builder.go:214
github.com/apecloud/kubeblocks/pkg/controller/kubebuilderx.(*controller).Commit
	/src/pkg/controller/kubebuilderx/controller.go:117
github.com/apecloud/kubeblocks/controllers/workloads.(*InstanceSetReconciler).Reconcile
	/src/controllers/workloads/instanceset_controller.go:92
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227

Desktop (please complete the following information):

Kubernetes: v1.26.5+k3s1
KubeBlocks: 0.9.0
kbcli: 0.9.0
@kissycn kissycn added the kind/bug Something isn't working label Sep 6, 2024
@shanshanying
Copy link
Contributor

hi @kissycn
thanks for reporting the bug. We will check the root cause.

@shanshanying
Copy link
Contributor

hi @kissycn
pls check kubeblocks logs and see if there is any sub resources not deleted.
If any please paste the logs and check why they are blocked from being deletion.

@nayutah nayutah assigned shanshanying and unassigned nayutah Sep 9, 2024
@shanshanying shanshanying changed the title [BUG] AdditionalErrorMsg: Precondition failed When delete cluster [BUG] KubeBlocks reports 'deleting the sub-resource kinds: []' but the cluster won't be deleted. Sep 25, 2024
@shanshanying
Copy link
Contributor

Hi @kissycn

I reproduced the issue and found: configmaps for configs and scripts blocked the cluster cr from being deleted. KB reports "deleting the sub-resource kinds: []". We will check it out.

@shanshanying
Copy link
Contributor

fixed in kb 092 and kb 1.0

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

When branches are created from issues, their pull requests are automatically linked.

4 participants