Repository: apecloud/kubeblocks

Issue:
[BUG] kubeblocks v1.0.0-beta.39 pod crash Observed a panic in reconciler
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
```
kubectl get pod -n kb-system 
NAME                                         READY   STATUS    RESTARTS      AGE
kbcli-test-minio-79497b7755-q9t88            1/1     Running   0             32h
kubeblocks-577c6db77b-9swvf                  0/1     Error     4 (68s ago)   6m40s
kubeblocks-dataprotection-6fd489bf7f-gj8z4   1/1     Running   0             6m40s
```
```
 kubectl logs -n kb-system kubeblocks-577c6db77b-9swvf 
Defaulted container "manager" out of: manager, tools (init)
2025-04-01T11:01:15.519Z	INFO	ImageUtil	registriesConfig reloaded	{"registriesConfig": {"DefaultRegistry":"apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com","DefaultNamespace":"apecloud","RegistryConfig":null}}
2025-04-01T11:01:15.519Z	INFO	setup	config file: /etc/kubeblocks/config.yaml
2025-04-01T11:01:15.519Z	INFO	setup	config settings: map[api-version-supported: apps:true cert_dir:/tmp/k8s-webhook-server/serving-certs cm_namespace:kb-system cm_recon_retry_duration_ms:1000 config_manager_grpc_port:9901 config_manager_log_level:info data_plane_affinity:{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"preference":{"matchExpressions":[{"key":"kb-data","operator":"In","values":["true"]}]},"weight":100}]}} data_plane_tolerations:[{"effect":"NoSchedule","key":"kb-data","operator":"Equal","value":"true"}] default_storage_class: enabled_runtime_metrics:false enablerbacmanager:true experimental:false extensions:true health_probe_bind_address::8081 host_port_cm_name:kubeblocks-host-ports host_port_exclude_ranges:6443,10250,10257,10259,2379-2380,30000-32767 host_port_include_ranges:1025-65536 i18n_resources_name:kubeblocks-i18n-resources ignore_config_template_default_mode:false ignore_pod_vertical_scaling:false in_place_pod_vertical_scaling:false kubeblocks_addon_helm_install_options:--atomic --cleanup-on-fail --wait --insecure-skip-tls-verify kubeblocks_addon_helm_uninstall_options:[] kubeblocks_addon_sa_name:kubeblocks-addon-installer kubeblocks_reconcile_workers:8 kubeblocks_serviceaccount_name:kubeblocks kubeblocks_tools_image:apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:1.0.0-beta.39 kubeconfig: kubernetes_cluster_domain:cluster.local leader_elect:true leader_elect_id:001c317f managed_namespaces: max_plain_revision_count:1024 maxconcurrentreconciles_addon:8 metrics_bind_address::8080 multi_cluster_contexts: multi_cluster_contexts_disabled: multi_cluster_kubeconfig: operations:true parameters:true pod_min_ready_seconds:10 registries:map[defaultnamespace:apecloud defaultregistry:apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com] trace:false user_agent:kubeblocks volumesnapshot_api_beta:false workloads:true zap_devel:false zap_encoder:console zap_log_level: zap_stacktrace_level: zap_time_encoding:iso8601]
2025-04-01T11:01:15.519Z	INFO	setup	golang runtime metrics.	{"featureGate": false}
2025-04-01T11:01:15.540Z	INFO	setup	starting manager
2025-04-01T11:01:15.540Z	INFO	controller-runtime.metrics	Starting metrics server
2025-04-01T11:01:15.540Z	INFO	starting server	{"kind": "health probe", "addr": "[::]:8081"}
2025-04-01T11:01:15.540Z	INFO	controller-runtime.metrics	Serving metrics server	{"bindAddress": ":8080", "secure": false}
I0401 11:01:15.540752       1 leaderelection.go:250] attempting to acquire leader lease kb-system/001c317f.kubeblocks.io...
I0401 11:01:33.684827       1 leaderelection.go:260] successfully acquired lease kb-system/001c317f.kubeblocks.io
2025-04-01T11:01:33.684Z	INFO	Starting EventSource	{"controller": "clusterdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ClusterDefinition", "source": "kind source: *v1.ClusterDefinition"}
2025-04-01T11:01:33.684Z	INFO	Starting Controller	{"controller": "clusterdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ClusterDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "shardingdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ShardingDefinition", "source": "kind source: *v1.ShardingDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "shardingdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ShardingDefinition"}
2025-04-01T11:01:33.684Z	INFO	Starting EventSource	{"controller": "componentdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentDefinition", "source": "kind source: *v1.ComponentDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "sidecardefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "SidecarDefinition", "source": "kind source: *v1.SidecarDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "sidecardefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "SidecarDefinition", "source": "kind source: *v1.ComponentDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "sidecardefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "SidecarDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "componentdefinition", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1.Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1.Component"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.Component"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1.Service"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.InstanceSet"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.Service"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.Secret"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.ConfigMap"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.RoleBinding"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.Role"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.ServiceAccount"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "componentversion", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentVersion", "source": "kind source: *v1.ComponentVersion"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1alpha1.Restore"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "componentversion", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentVersion", "source": "kind source: *v1.ComponentDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.PersistentVolumeClaim"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "servicedescriptor", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ServiceDescriptor", "source": "kind source: *v1.ServiceDescriptor"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "servicedescriptor", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ServiceDescriptor"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1.Secret"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "event", "controllerGroup": "", "controllerKind": "Event", "source": "kind source: *v1.Event"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "event", "controllerGroup": "", "controllerKind": "Event"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsdefinition", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsDefinition", "source": "kind source: *v1alpha1.OpsDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "opsdefinition", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "componentversion", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "ComponentVersion"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.InstanceSet"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.PersistentVolumeClaim"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.Job"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "addon", "controllerGroup": "extensions.kubeblocks.io", "controllerKind": "Addon", "source": "kind source: *v1alpha1.Addon"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.Service"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "addon", "controllerGroup": "extensions.kubeblocks.io", "controllerKind": "Addon", "source": "kind source: *v1.Job"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "addon", "controllerGroup": "extensions.kubeblocks.io", "controllerKind": "Addon"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.ConfigMap"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet", "source": "kind source: *v1.Pod"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "instanceset", "controllerGroup": "workloads.kubeblocks.io", "controllerKind": "InstanceSet"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "parameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "Parameter", "source": "kind source: *v1alpha1.Parameter"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "parameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "Parameter", "source": "kind source: *v1.Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "parameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "Parameter"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1alpha1.OpsRequest"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1.Job"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1alpha1.Restore"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1alpha1.Parameter"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1.Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1.InstanceSet"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1alpha1.Backup"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1.PersistentVolumeClaim"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest", "source": "kind source: *v1.Pod"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "opsrequest", "controllerGroup": "operations.kubeblocks.io", "controllerKind": "OpsRequest"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "componentparameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ComponentParameter", "source": "kind source: *v1alpha1.ComponentParameter"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "componentparameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ComponentParameter", "source": "kind source: *v1.ConfigMap"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "componentparameter", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ComponentParameter"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "source": "kind source: *v1.Component"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "parametersdefinition", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParametersDefinition", "source": "kind source: *v1alpha1.ParametersDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "parametersdefinition", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParametersDefinition", "source": "kind source: *v1alpha1.ParametersDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "parametersdefinition", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParametersDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1.Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "source": "kind source: *v1alpha1.ComponentParameter"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "parametersdefinition", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParametersDefinition"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "configmap", "controllerGroup": "", "controllerKind": "ConfigMap", "source": "kind source: *v1.ConfigMap"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "configmap", "controllerGroup": "", "controllerKind": "ConfigMap"}
2025-04-01T11:01:33.685Z	INFO	Starting EventSource	{"controller": "paramconfigrenderer", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParamConfigRenderer", "source": "kind source: *v1alpha1.ParamConfigRenderer"}
2025-04-01T11:01:33.685Z	INFO	Starting Controller	{"controller": "paramconfigrenderer", "controllerGroup": "parameters.kubeblocks.io", "controllerKind": "ParamConfigRenderer"}
2025-04-01T11:01:33.798Z	INFO	Starting workers	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "worker count": 1}
2025-04-01T11:01:33.866Z	INFO	Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"orcm-ovyaoa-orchestrator","namespace":"default"}, "namespace": "default", "name": "orcm-ovyaoa-orchestrator", "reconcileID": "249231ea-643a-47bf-89a4-ab8ce4b6fc34"}
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=0x0 pc=0x1fa3c7b]

goroutine 729 [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({0x2431d60?, 0x41a3fb0?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/apecloud/kubeblocks/pkg/controller/configuration.ClassifyParamsFromConfigTemplate(0x2bfa170?, 0xc001502000, {0x0?, 0x7?, 0xc000ea0c30?}, 0x18?, 0x0)
	/src/pkg/controller/configuration/parameter_utils.go:45 +0xbb
github.com/apecloud/kubeblocks/controllers/parameters.buildComponentParameter({{0x2bfa170, 0xc000f78c00}, {{{0xc000f5cc80, 0x7}, {0xc000ea0c30, 0x18}}}, {{0x2c006e8, 0xc000f78e40}, 0x0}, {0x2bf77c0, ...}}, ...)
	/src/controllers/parameters/componentdrivenparameter_controller.go:206 +0x1ae
github.com/apecloud/kubeblocks/controllers/parameters.(*ComponentDrivenParameterReconciler).reconcile(0xc000872c90, {{0x2bfa170, 0xc000f78c00}, {{{0xc000f5cc80, 0x7}, {0xc000ea0c30, 0x18}}}, {{0x2c006e8, 0xc000f78e40}, 0x0}, ...}, ...)
	/src/controllers/parameters/componentdrivenparameter_controller.go:108 +0x10d
github.com/apecloud/kubeblocks/controllers/parameters.(*ComponentDrivenParameterReconciler).Reconcile(0xc000872c90, {0x2bfa170, 0xc000f78c00}, {{{0xc000f5cc80?, 0x5?}, {0xc000ea0c30?, 0xc000c3fd08?}}})
	/src/controllers/parameters/componentdrivenparameter_controller.go:87 +0x3d0
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x2c006e8?, {0x2bfa170?, 0xc000f78c00?}, {{{0xc000f5cc80?, 0xb?}, {0xc000ea0c30?, 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(0xc0008e8f00, {0x2bfa1a8, 0xc0003aac80}, {0x253dc20?, 0xc0008a8600?})
	/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(0xc0008e8f00, {0x2bfa1a8, 0xc0003aac80})
	/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 202
	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:223 +0x565
```


**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.


Discussion:

Solution patch:
diff --git a/controllers/parameters/componentdrivenparameter_controller.go b/controllers/parameters/componentdrivenparameter_controller.go
index d845fb93b..d27897a88 100644
--- a/controllers/parameters/componentdrivenparameter_controller.go
+++ b/controllers/parameters/componentdrivenparameter_controller.go
@@ -207,12 +207,12 @@ func buildComponentParameter(reqCtx intctrlutil.RequestCtx, reader client.Reader
 	if err != nil {
 		return nil, err
 	}
-	if err = handleCustomParameterTemplate(reqCtx.Ctx, reader, comp.Spec.Annotations, parameterSpecs); err != nil {
-		return nil, err
-	}
 	if len(parameterSpecs) == 0 {
 		return nil, nil
 	}
+	if err = handleCustomParameterTemplate(reqCtx.Ctx, reader, comp.Spec.Annotations, parameterSpecs); err != nil {
+		return nil, err
+	}
 
 	clusterName, _ := component.GetClusterName(comp)
 	componentName, _ := component.ShortName(clusterName, comp.Name)
diff --git a/controllers/parameters/parameter_util.go b/controllers/parameters/parameter_util.go
index 13adffe09..f549aa61a 100644
--- a/controllers/parameters/parameter_util.go
+++ b/controllers/parameters/parameter_util.go
@@ -135,6 +135,9 @@ func updateCustomTemplates(rctx *ReconcileContext, parameter *parametersv1alpha1
 
 func classifyParameters(updatedParameters parametersv1alpha1.ComponentParameters, configmaps map[string]*corev1.ConfigMap) func(*ReconcileContext, *parametersv1alpha1.Parameter) error {
 	return func(rctx *ReconcileContext, parameter *parametersv1alpha1.Parameter) error {
+		if !configctrl.HasValidParameterTemplate(rctx.ConfigRender) {
+			return intctrlutil.NewFatalError(fmt.Sprintf("component[%s] does not support reconfigure", rctx.ComponentName))
+		}
 		classParameters, err := configctrl.ClassifyComponentParameters(updatedParameters,
 			flatten(rctx.ParametersDefs),
 			rctx.ComponentDefObj.Spec.Configs,
diff --git a/pkg/controller/configuration/parameter_utils.go b/pkg/controller/configuration/parameter_utils.go
index 4e90ffae9..fdcbc1408 100644
--- a/pkg/controller/configuration/parameter_utils.go
+++ b/pkg/controller/configuration/parameter_utils.go
@@ -42,6 +42,9 @@ func ClassifyParamsFromConfigTemplate(params parametersv1alpha1.ComponentParamet
 	if err != nil {
 		return nil, err
 	}
+	if !HasValidParameterTemplate(pcr) {
+		return nil, nil
+	}
 	for _, template := range ResolveParameterTemplate(cmpd.Spec, pcr.Spec) {
 		itemDetails = append(itemDetails, generateConfigTemplateItem(classifyParams, template))
 	}
@@ -63,6 +66,10 @@ func ResolveParameterTemplate(cmpd appsv1.ComponentDefinitionSpec, pcr parameter
 	return templates
 }
 
+func HasValidParameterTemplate(pcr *parametersv1alpha1.ParamConfigRenderer) bool {
+	return pcr != nil && len(pcr.Spec.Configs) != 0
+}
+
 func generateConfigTemplateItem(configParams map[string]map[string]*parametersv1alpha1.ParametersInFile, template appsv1.ComponentFileTemplate) parametersv1alpha1.ConfigTemplateItemDetail {
 	itemDetail := parametersv1alpha1.ConfigTemplateItemDetail{
 		Name:       template.Name,
@@ -80,7 +87,7 @@ func ClassifyComponentParameters(parameters parametersv1alpha1.ComponentParamete
 	templates []appsv1.ComponentFileTemplate,
 	tpls map[string]*corev1.ConfigMap,
 	pcr *parametersv1alpha1.ParamConfigRenderer) (map[string]map[string]*parametersv1alpha1.ParametersInFile, error) {
-	if len(parameters) == 0 {
+	if len(parameters) == 0 || !HasValidParameterTemplate(pcr) {
 		return nil, nil
 	}
 	if !hasValidParametersDefinition(parametersDefs) {



Test patch:
diff --git a/controllers/parameters/componentdrivenparameter_controller_test.go b/controllers/parameters/componentdrivenparameter_controller_test.go
index b0230221a..98310c47e 100644
--- a/controllers/parameters/componentdrivenparameter_controller_test.go
+++ b/controllers/parameters/componentdrivenparameter_controller_test.go
@@ -143,4 +143,35 @@ var _ = Describe("ComponentParameterGenerator Controller", func() {
 			})).Should(Succeed())
 		})
 	})
+
+	Context("No ParamConfigRenderer", func() {
+		It("NPE test", func() {
+			initTestResource()
+
+			By("Create a component definition obj without ParamConfigRenderer")
+			key := testapps.GetRandomizedKey(testCtx.DefaultNamespace, compDefName)
+			compDefObj := testapps.NewComponentDefinitionFactory(key.Name).
+				WithRandomName().
+				SetDefaultSpec().
+				AddConfigTemplate(configSpecName, configSpecName, testCtx.DefaultNamespace, configVolumeName).
+				Create(&testCtx).
+				GetObject()
+			Expect(testapps.GetAndChangeObjStatus(&testCtx, client.ObjectKeyFromObject(compDefObj), func(obj *appsv1.ComponentDefinition) {
+				obj.Status.Phase = appsv1.AvailablePhase
+			})()).Should(Succeed())
+
+			By("Create a component obj depends on the new cmpd")
+			key = testapps.GetRandomizedKey(testCtx.DefaultNamespace, defaultCompName)
+			compObj := testapps.NewComponentFactory(testCtx.DefaultNamespace, key.Name, compDefObj.Name).
+				AddLabels(constant.AppInstanceLabelKey, clusterName).
+				AddAnnotations(constant.CRDAPIVersionAnnotationKey, appsv1.GroupVersion.String()).
+				SetUID(types.UID("test-uid")).
+				SetReplicas(1).
+				Create(&testCtx).
+				GetObject()
+
+			Eventually(testapps.CheckObjExists(&testCtx, client.ObjectKeyFromObject(compObj), &appsv1.Component{}, true)).Should(Succeed())
+			Eventually(testapps.CheckObjExists(&testCtx, client.ObjectKeyFromObject(compObj), &parametersv1alpha1.ComponentParameter{}, false)).Should(Succeed())
+		})
+	})
 })