apache/dolphinscheduler · error · IllegalArgumentException
sagemaker datasource param is not valid
Error message
sagemaker datasource param is not valid
What it means
K8sDataSourceProcessor.checkDatasourceParam validates that the K8s datasource supplies a non-empty kubeConfig; if empty it throws IllegalArgumentException. The message misleadingly mentions 'sagemaker' — a leftover copy-paste from the sagemaker processor — but the check is about the missing kubeConfig field.
Source
Thrown at dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-k8s/src/main/java/org/apache/dolphinscheduler/plugin/datasource/k8s/param/K8sDataSourceProcessor.java:52
import lombok.extern.slf4j.Slf4j;
import com.google.auto.service.AutoService;
@AutoService(DataSourceProcessor.class)
@Slf4j
public class K8sDataSourceProcessor extends AbstractDataSourceProcessor {
@Override
public BaseDataSourceParamDTO castDatasourceParamDTO(String paramJson) {
return JSONUtils.parseObject(paramJson, K8sDataSourceParamDTO.class);
}
@Override
public void checkDatasourceParam(BaseDataSourceParamDTO datasourceParam) {
K8sDataSourceParamDTO k8sDataSourceParamDTO = (K8sDataSourceParamDTO) datasourceParam;
if (StringUtils.isEmpty(k8sDataSourceParamDTO.getKubeConfig())) {
throw new IllegalArgumentException("sagemaker datasource param is not valid");
}
}
@Override
public String getDatasourceUniqueId(ConnectionParam connectionParam, DbType dbType) {
K8sConnectionParam baseConnectionParam = (K8sConnectionParam) connectionParam;
return MessageFormat.format("{0}@{1}@{2}", dbType.getName(),
PasswordUtils.encodePassword(baseConnectionParam.getKubeConfig()), baseConnectionParam.getNamespace());
}
@Override
public BaseDataSourceParamDTO createDatasourceParamDTO(String connectionJson) {
K8sConnectionParam connectionParams = (K8sConnectionParam) createConnectionParams(connectionJson);
K8sDataSourceParamDTO k8sDataSourceParamDTO = new K8sDataSourceParamDTO();
k8sDataSourceParamDTO.setKubeConfig(connectionParams.getKubeConfig());
k8sDataSourceParamDTO.setNamespace(connectionParams.getNamespace());
return k8sDataSourceParamDTO;
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Provide a valid kubeConfig content in the K8s datasource form (paste the ~/.kube/config YAML)
- Verify the API request body includes kubeConfig (JSON field name) when creating the datasource programmatically
- If this is your fork, fix the copy-paste error message to reference k8s/kubeConfig
Example fix
// before
POST /datasources {"type":"K8S","name":"myk8s"} // no kubeConfig -> error
// after
POST /datasources {"type":"K8S","name":"myk8s","kubeConfig":"apiVersion: v1\nclusters: ..."} Defensive patterns
Strategy: validation
Validate before calling
if (k8sParam.getKubeConfig() == null || k8sParam.getKubeConfig().trim().isEmpty()) {
throw new IllegalArgumentException("kubeConfig is required for K8s datasource");
} Try / catch
try {
processor.checkDatasourceParam(dto);
} catch (IllegalArgumentException e) {
ui.showError("K8s datasource requires a non-empty kubeConfig");
} Prevention
- Require kubeConfig in the datasource creation form/UI before submit
- Validate API payloads for kubeConfig when automating datasource creation
- Ignore the misleading 'sagemaker' wording — it means kubeConfig is missing
When it happens
Trigger: Creating/updating a K8s-type datasource whose kubeConfig field is empty or whitespace-only; the processor casts the param DTO and rejects before persistence.
Common situations: Saving a K8s datasource without pasting the kubeconfig YAML; UI field left blank; copying a datasource definition programmatically and omitting kubeConfig.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- 1300006
- REQUEST_PARAMS_NOT_VALID_ERROR
- DataX job definition is missing, provide inline json or atta
- dinky task params is not valid
- url can not be null
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/73fa505a3872c6ee.
Report an issue: GitHub.