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] Create TiDB cluster panic in controller transform #7379

Closed
nayutah opened this issue May 16, 2024 · 1 comment · Fixed by #7395
Closed

[BUG] Create TiDB cluster panic in controller transform #7379

nayutah opened this issue May 16, 2024 · 1 comment · Fixed by #7395
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@nayutah
Copy link
Collaborator

nayutah commented May 16, 2024

Describe the bug
When create a TiDB cluster with 0.9.0, controller transformer paniced.

To Reproduce
Steps to reproduce the behavior:

  1. git checkout -b tidb origin/feat/tidb-addon-revamp
  2. sed -e 's/v7.1.2/v7.1.5/g'
  3. helm template tidb | kubectl apply -f -
  4. helm template tidb-cluster | kubectl apply -f -

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
2024-05-16T17:30:24.107Z INFO Starting workers {"controller": "clusterversion", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ClusterVersion", "worker count": 1}
2024-05-16T17:30:24.112Z INFO Starting workers {"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "worker count": 2}
2024-05-16T17:30:24.113Z INFO Starting workers {"controller": "componentversion", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentVersion", "worker count": 1}
2024-05-16T17:30:24.113Z INFO Starting workers {"controller": "clusterdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ClusterDefinition", "worker count": 1}
2024-05-16T17:30:24.113Z INFO Starting workers {"controller": "componentdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentDefinition", "worker count": 1}
2024-05-16T17:30:24.122Z INFO Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference {"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "Cluster": {"name":"release-name-tidb-cluster","namespace":"default"}, "namespace": "default", "name": "release-name-tidb-cluster", "reconcileID": "5c2db182-084e-43dd-bce6-c1f66ae341fd"}
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=0x20 pc=0x24aaff1]

goroutine 803 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x2849fa0?, 0x4b1c990?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/apecloud/kubeblocks/controllers/apps.(*clusterBackupPolicyTransformer).Transform.func2({0xc001f60770, {0xc00105e648, 0x4}, 0x0, {0xc00105e648, 0x4}}, 0xc001f67520, 0x0)
/src/controllers/apps/transformer_cluster_backup_policy.go:162 +0x251
github.com/apecloud/kubeblocks/controllers/apps.(*clusterBackupPolicyTransformer).Transform(0xc001f3dc80, {0x32f6078?, 0xc000fde6e0?}, 0xc0019f9170)
/src/controllers/apps/transformer_cluster_backup_policy.go:181 +0x6f2
github.com/apecloud/kubeblocks/pkg/controller/graph.TransformerChain.ApplyTo({0xc000a56c00?, 0x10, 0x4b6ccc0?}, {0x32f6078, 0xc000fde6e0}, 0xc000aa78f0?)
/src/pkg/controller/graph/transformer.go:57 +0x9b
github.com/apecloud/kubeblocks/controllers/apps.(*clusterPlanBuilder).Build(0xc000ac3270)
/src/controllers/apps/cluster_plan_builder.go:174 +0x12f
github.com/apecloud/kubeblocks/controllers/apps.(*ClusterReconciler).Reconcile(0xc000424540, {0x32f6430, 0xc00133f440}, {{{0xc000fa1ff6, 0x7}, {0xc000444440, 0x19}}})
/src/controllers/apps/cluster_controller.go:162 +0x85c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x32fc648?, {0x32f6430?, 0xc00133f440?}, {{{0xc000fa1ff6?, 0xb?}, {0xc000444440?, 0x0?}}})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000cb6280, {0x32f6468, 0xc000ac2230}, {0x2986e60?, 0xc001003700?})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000cb6280, {0x32f6468, 0xc000ac2230})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266 +0x1af
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 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 119
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:223 +0x565

Desktop (please complete the following information):
Kubernetes: v1.29.4+k3s1
KubeBlocks: 0.9.0-beta.25
kbcli: 0.8.2
WARNING: version difference between kbcli (0.8.2) and kubeblocks (0.9.0-beta.25)

@nayutah nayutah added the kind/bug Something isn't working label May 16, 2024
@free6om
Copy link
Contributor

free6om commented May 21, 2024

image

@free6om free6om assigned wangyelei and unassigned free6om May 21, 2024
@github-actions github-actions bot added this to the Release 0.8.3 milestone May 21, 2024
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

Successfully merging a pull request may close this issue.

3 participants