{"record":{"id":"918bf8097b3f2f46","repo":"apache/dolphinscheduler","slug":"120023","errorCode":"120023","errorMessage":"this cluster config shouldn't be empty.","messagePattern":"this cluster config shouldn't be empty\\.","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java","lineNumber":290,"sourceCode":"            throw new ServiceException(Status.USER_NO_OPERATION_PERM);\n        }\n\n        if (StringUtils.isEmpty(clusterName)) {\n            throw new ServiceException(Status.CLUSTER_NAME_IS_NULL);\n        }\n\n        Cluster cluster = clusterDao.queryByClusterName(clusterName);\n        if (cluster != null) {\n            throw new ServiceException(Status.CLUSTER_NAME_EXISTS);\n        }\n    }\n\n    protected void checkParams(String name, String config) {\n        if (StringUtils.isEmpty(name)) {\n            throw new ServiceException(Status.CLUSTER_NAME_IS_NULL);\n        }\n        if (StringUtils.isEmpty(config)) {\n            throw new ServiceException(Status.CLUSTER_CONFIG_IS_NULL);\n        }\n    }\n\n}\n","sourceCodeStart":272,"sourceCodeEnd":295,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java#L272-L295","documentation":"ClusterServiceImpl.checkParams throws this when the cluster 'config' string is empty. The config holds the cluster's YAML/connection configuration used by K8s and other task execution, so it cannot be blank. Maps to Status.CLUSTER_CONFIG_IS_NULL (code 120023).","triggerScenarios":"createCluster or updateClusterByCode request body containing name but an empty 'config' field (\"\").","commonSituations":"Users register a cluster intending to paste kubeconfig later; scripts building the payload omit the config key; UI saves before config textarea is populated.","solutions":["Provide the full cluster configuration string (e.g. kubeconfig YAML) in the 'config' field.","Validate on the client that config is non-empty (and ideally parseable YAML) before submitting.","If updating, fetch the existing cluster and reuse its current config when no change is intended."],"exampleFix":"// before\nclusterService.checkParams(name, config); // config == \"\"\n// after\nString config = loadKubeConfig(); // ensure non-empty YAML\nclusterService.checkParams(name, config);","handlingStrategy":"validation","validationCode":"if (config == null || config.trim().isEmpty()) { throw new IllegalArgumentException(\"cluster config is required\"); }","typeGuard":"boolean hasClusterConfig(Map<String,Object> body) { Object c = body.get(\"config\"); return c instanceof String && !((String) c).trim().isEmpty(); }","tryCatchPattern":"try { api.updateClusterByCode(code, body); } catch (ServiceException e) { if (e.getCode() == 120023) { /* load existing config or prompt */ } else throw e; }","preventionTips":["Load kubeconfig from a file and fail early if empty","Never submit cluster create/update with blank config","On update, reuse existing config when unchanged"],"tags":["cluster","validation","empty-field"],"backgroundTag":"empty-required-field","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}