apache/dolphinscheduler · error · ServiceException
1300006
1300006
Error message
k8s error with exception {0} What it means
When updating a cluster whose config changed (and it is not the local test cluster), updateClusterByCode calls k8sManager.getAndUpdateK8sClient(code, true) to rebuild the Kubernetes client; any exception there is rethrown as ServiceException(Status.K8S_CLIENT_OPS_ERROR, name; code 1300006) with message "k8s error with exception {0}". It signals the new cluster config could not be used to establish a working K8s client, so the update is aborted.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java:248
checkParams(name, config);
Cluster clusterExistByName = clusterDao.queryByClusterName(name);
if (clusterExistByName != null && !clusterExistByName.getCode().equals(code)) {
throw new ServiceException(Status.CLUSTER_NAME_EXISTS, name);
}
Cluster clusterExist = clusterDao.queryByClusterCode(code);
if (clusterExist == null) {
throw new ServiceException(Status.CLUSTER_NOT_EXISTS, name);
}
if (!Constants.K8S_LOCAL_TEST_CLUSTER_CODE.equals(clusterExist.getCode())
&& !config.equals(ClusterConfUtils.getK8sConfig(clusterExist.getConfig()))) {
try {
k8sManager.getAndUpdateK8sClient(code, true);
} catch (Exception e) {
throw new ServiceException(Status.K8S_CLIENT_OPS_ERROR, name);
}
}
// update cluster
// need not update relation
clusterExist.setConfig(config);
clusterExist.setName(name);
clusterExist.setDescription(desc);
clusterExist.setUpdateTime(DateUtils.getCurrentDate());
clusterDao.updateById(clusterExist);
return clusterExist;
}
/**
* verify cluster name
*
* @param loginUser login user
* @param clusterName cluster nameView on GitHub (pinned to 02eac45a1b)
Solutions
- Validate the new kube config (e.g. kubectl --kubeconfig <file> cluster-info) from the DolphinScheduler API server host before saving.
- Check network reachability to the K8s API server (host, port, DNS, firewall) from the API server container/host.
- Inspect the wrapped exception message in the API server logs for the root cause (the {0} parameter carries it).
- Ensure certificates/keys and tokens in the config are current and correctly indented YAML.
- Retry the update once the K8s connection issue is fixed.
Example fix
// before: saving unverified config String config = newKubeconfigYaml; clusterService.updateClusterByCode(loginUser, code, name, config, desc); // after: test the client first KubeConfigValidation.validateOrThrow(newKubeconfigYaml); // runs kubectl-equivalent check clusterService.updateClusterByCode(loginUser, code, name, newKubeconfigYaml, desc);
Defensive patterns
Strategy: validation
Validate before calling
// Bash: validate kubeconfig from the API server host before saving kubectl --kubeconfig /tmp/new-config cluster-info || echo "invalid or unreachable cluster config"
Try / catch
try {
clusterService.updateClusterByCode(loginUser, code, name, config, desc);
} catch (ServiceException e) {
if (e.getCode() == 1300006) {
log.error("K8s client could not be built from new config; check logs for root cause", e);
// do NOT persist config; roll back UI form state
} else {
throw e;
}
} Prevention
- Test kube configs with kubectl from the API server host before saving
- Track certificate/token expiry for managed clusters
- Verify network/VPN paths to K8s API servers
- Keep a known-good config copy for rollback
When it happens
Trigger: PUT /clusters/{code} with a modified kubeconfig/config field for a non-test cluster where getAndUpdateK8sClient throws — invalid kubeconfig YAML, unreachable API server, bad certificates, wrong context, or expired tokens.
Common situations: Typo in the kube config; K8s API server behind a firewall/VPN not reachable from the API server host; rotated cluster certificates not yet updated in DolphinScheduler; switching contexts to a cluster that was decommissioned.
Related errors
- sagemaker datasource param is not valid
- WorkflowInstance: %s pause failed
- WorkflowInstance: %s stop failed
- OIDC_TOKEN_EXCHANGE_FAILED
- 110014
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/092c02d788afd27d.
Report an issue: GitHub.