Closed
Description
Describe the bug
kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.9.0-beta.20
kbcli: 0.9.0-beta.6
To Reproduce
Steps to reproduce the behavior:
- create cluster
kbcli cluster create mysql-juhyvt --termination-policy=WipeOut --cluster-definition=apecloud-mysql --enable-all-logs=false --cluster-version=ac-mysql-8.0.30 --set cpu=100m,memory=0.5Gi,replicas=3,storage=1Gi --namespace default
- See error
kbcli cluster configure mysql-juhyvt --auto-approve --force=true --set consensus_log_level=LOG_INFO,log_error_verbosity=3 --components mysql --config-spec mysql-consensusset-config --config-file my.cnf --namespace default
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x106c07a94]
goroutine 1 [running]:
github.com/apecloud/kubeblocks/pkg/controllerutil.MergeAndValidateConfigs({0x0, 0x0, 0x0, 0x0, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)
/home/runner/go/pkg/mod/github.com/apecloud/kubeblocks@v0.9.0-beta.18/pkg/controllerutil/config_util.go:69 +0x134
github.com/apecloud/kbcli/pkg/cmd/cluster.(*configOpsOptions).validateConfigParams(0x14001176ea0, 0x14000b36b90)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/config_ops.go:156 +0x250
github.com/apecloud/kbcli/pkg/cmd/cluster.(*configOpsOptions).Validate(0x14001176ea0)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/config_ops.go:131 +0x14c
github.com/apecloud/kbcli/pkg/cmd/cluster.NewReconfigureCmd.func1(0x14000b85000?, {0x14000dc3c70?, 0x1?, 0xd?})
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/config_ops.go:272 +0xb4
github.com/spf13/cobra.(*Command).execute(0x1400116e600, {0x14000dc3ba0, 0xd, 0xd})
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x14000c74c00)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
k8s.io/component-base/cli.run(0x14000c74c00)
/home/runner/go/pkg/mod/k8s.io/component-base@v0.28.3/cli/run.go:146 +0x264
k8s.io/component-base/cli.RunNoErrOutput(...)
/home/runner/go/pkg/mod/k8s.io/component-base@v0.28.3/cli/run.go:84
main.main()
/home/runner/work/kbcli/kbcli/cmd/cli/main.go:31 +0x20
kbcli cluster update mysql-juhyvt --enable-all-logs=true --namespace default
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103472304]
goroutine 1 [running]:
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).reconfigureLogVariables.func1({{0x140006cb140, 0x5}, {0x140006caffa, 0x5}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:483 +0x154
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).reconfigureLogVariables(0x140014c6c00?, 0x140014c6c00, 0x14000503380)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:502 +0x170
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).updateEnabledLog(0x140015c7100, {0x1039a9fae?, 0x16ef9b8cd?})
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:440 +0x240
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).buildComponents(0x140015c7100?, {0x1039ccec8?, 0xf?}, {0x1039a9fae?, 0x4?})
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:381 +0x164
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).buildPatch.func3(0x104860aa0?, {0x104695b00?, 0x140015cd7c0?}, {0x1039ccec8?, 0x14001627aa8?})
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:258 +0x54
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).buildPatch(0x140015c7100)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:303 +0xaa8
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).Complete(0x140015c7100)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:234 +0xc8
github.com/apecloud/kbcli/pkg/cmd/cluster.(*UpdateOptions).Exec(0x140015c7100)
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:217 +0x2c
github.com/apecloud/kbcli/pkg/cmd/cluster.NewUpdateCmd.func1(0x140015c7200?, {0x140005e4900?, 0x1?, 0x4?})
/home/runner/work/kbcli/kbcli/pkg/cmd/cluster/update.go:140 +0x48
github.com/spf13/cobra.(*Command).execute(0x140015e9800, {0x140005e48c0, 0x4, 0x4})
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x14000df0f00)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
k8s.io/component-base/cli.run(0x14000df0f00)
/home/runner/go/pkg/mod/k8s.io/component-base@v0.28.3/cli/run.go:146 +0x264
k8s.io/component-base/cli.RunNoErrOutput(...)
/home/runner/go/pkg/mod/k8s.io/component-base@v0.28.3/cli/run.go:84
main.main()
/home/runner/work/kbcli/kbcli/cmd/cli/main.go:31 +0x20
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.