Crash with ClusterStack Resource with empty `providerRef` and `noProvider`
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- go
调研方向
Reproduce the crash with the ClusterStack spec in the issue, then start at internal/controller/clusterstack_controller.go:275 and trace back through Reconcile at line 178. Check the missing providerRef/noProvider error path and determine why handling or printing the error dereferences nil. Done means the same resource produces an error without panicking.
由索引模型根据 Issue 内容生成。
描述
The CSO crashes with the following ClusterStack spec
apiVersion: clusterstack.x-k8s.io/v1alpha1
kind: ClusterStack
metadata:
name: scs-cluster-stack
namespace: default
spec:
provider: openstack
name: scs
kubernetesVersion: "1.27"
channel: stable
autoSubscribe: false
versions:
- v4
I think the missing providerRef is actually detected and the crash happens when printing the Error message, however i have not investigated deeply. The crashlog is:
{"level":"INFO","time":"2024-05-22T09:15:41.002Z","file":"controller/controller.go:115","message":"Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference","controller":"clusterstack","controllerGroup":"clusterstack.x-k8s.io","controllerKind":"ClusterStack","ClusterStack":{"name":"scs-cluster-stack","namespace":"default"},"namespace":"default","name":"scs-cluster-stack","reconcileID":"66ffaad8-291e-43a7-aa54-d5ba5f5ce8f3"}
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=0x19082d4]
goroutine 204 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x1b76920?, 0x313ed60?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/SovereignCloudStack/cluster-stack-operator/internal/controller.(*ClusterStackReconciler).createOrUpdateProviderClusterStackRelease(0xc00028fc00, {0x213be10, 0xc0006915c0}, {0xc0005a29f0, 0x15}, 0xc0003d2380)
/src/cluster-stack-operator/internal/controller/clusterstack_controller.go:275 +0xf4
github.com/SovereignCloudStack/cluster-stack-operator/internal/controller.(*ClusterStackReconciler).Reconcile(0xc00028fc00, {0x213be10?, 0xc0006915c0}, {{{0xc0002e0796?, 0x5?}, {0xc0002440d8?, 0xc0004a1d48?}}})
/src/cluster-stack-operator/internal/controller/clusterstack_controller.go:178 +0x1073
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x213f928?, {0x213be10?, 0xc0006915c0?}, {{{0xc0002e0796?, 0xb?}, {0xc0002440d8?, 0x0?}}})
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0004b4c80, {0x213be48, 0xc0003a6f00}, {0x1c5ec60?, 0xc0002230c0?})
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0004b4c80, {0x213be48, 0xc0003a6f00})
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266 +0x1c9
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 92
/src/cluster-stack-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:223 +0x565
- 主要语言
- Go
- 星标
- 18
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SovereignCloudStack/cluster-stack-operator 的其他 Issue
-
CI issues (1) 未关闭bug Container
SovereignCloudStack/cluster-stack-operator#340 · 1 条评论 · 已指派 3 人 ·
-
cso: crash .... 未关闭
难度 3/5 1-2 天 新手友好度 58/100
SovereignCloudStack/cluster-stack-operator#337 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 50/100
SovereignCloudStack/cluster-stack-operator#336 · 3 条评论 ·
-
bug
SovereignCloudStack/cluster-stack-operator#327 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 35/100
SovereignCloudStack/cluster-stack-operator#272 · 32 条评论 ·
查看 SovereignCloudStack/cluster-stack-operator 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
prometheus/procfs#872 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
bazel-contrib/rules_go#4726 · 1 条评论 ·
-
area/auto-scaling area/monitoring area/ops-productivity kind/enhancement
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 75/100