apache/dolphinscheduler · error · ServiceException

120023

120023

Error message

this cluster config shouldn't be empty.

What it means

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

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java:290

            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

        if (StringUtils.isEmpty(clusterName)) {
            throw new ServiceException(Status.CLUSTER_NAME_IS_NULL);
        }

        Cluster cluster = clusterDao.queryByClusterName(clusterName);
        if (cluster != null) {
            throw new ServiceException(Status.CLUSTER_NAME_EXISTS);
        }
    }

    protected void checkParams(String name, String config) {
        if (StringUtils.isEmpty(name)) {
            throw new ServiceException(Status.CLUSTER_NAME_IS_NULL);
        }
        if (StringUtils.isEmpty(config)) {
            throw new ServiceException(Status.CLUSTER_CONFIG_IS_NULL);
        }
    }

}

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Provide the full cluster configuration string (e.g. kubeconfig YAML) in the 'config' field.
  2. Validate on the client that config is non-empty (and ideally parseable YAML) before submitting.
  3. If updating, fetch the existing cluster and reuse its current config when no change is intended.

Example fix

// before
clusterService.checkParams(name, config); // config == ""
// after
String config = loadKubeConfig(); // ensure non-empty YAML
clusterService.checkParams(name, config);
Defensive patterns

Strategy: validation

Validate before calling

if (config == null || config.trim().isEmpty()) { throw new IllegalArgumentException("cluster config is required"); }

Type guard

boolean hasClusterConfig(Map<String,Object> body) { Object c = body.get("config"); return c instanceof String && !((String) c).trim().isEmpty(); }

Try / catch

try { api.updateClusterByCode(code, body); } catch (ServiceException e) { if (e.getCode() == 120023) { /* load existing config or prompt */ } else throw e; }

Prevention

When it happens

Trigger: createCluster or updateClusterByCode request body containing name but an empty 'config' field ("").

Common situations: Users register a cluster intending to paste kubeconfig later; scripts building the payload omit the config key; UI saves before config textarea is populated.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/918bf8097b3f2f46. Report an issue: GitHub.