apache/dolphinscheduler · error · TaskException
Kubeflow task params is not valid
Error message
Kubeflow task params is not valid
What it means
KubeflowTask.init() parses taskParams into KubeflowParameters, injects the cluster YAML from the K8s task execution context, and throws TaskException 'Kubeflow task params is not valid' when kubeflowParameters.checkParameters() fails. Note it also dereferences getK8sTaskExecutionContext() unguarded, so a null K8s context would NPE before this message.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-kubeflow/src/main/java/org/apache/dolphinscheduler/plugin/kubeflow/KubeflowTask.java:63
protected KubeflowHelper kubeflowHelper;
private KubeflowParameters kubeflowParameters;
private Path clusterYAMLPath;
private Path yamlPath;
public KubeflowTask(TaskExecutionContext taskExecutionContext) {
super(taskExecutionContext);
this.taskExecutionContext = taskExecutionContext;
}
@Override
public void init() throws TaskException {
kubeflowParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), KubeflowParameters.class);
log.info("Initialize Kubeflow task params {}", taskExecutionContext.getTaskParams());
kubeflowParameters.setClusterYAML(taskExecutionContext.getK8sTaskExecutionContext().getConfigYaml());
if (!kubeflowParameters.checkParameters()) {
throw new TaskException("Kubeflow task params is not valid");
}
writeFiles();
kubeflowHelper = new KubeflowHelper(clusterYAMLPath.toString());
}
@Override
public void submitApplication() throws TaskException {
String command = kubeflowHelper.buildSubmitCommand(yamlPath.toString());
log.info("Kubeflow task submit command: \n{}", command);
String message = runCommand(command);
log.info("Kubeflow task submit result: \n{}", message);
KubeflowHelper.ApplicationIds applicationIds = new KubeflowHelper.ApplicationIds();
applicationIds.setAlreadySubmitted(true);
setAppIds(JSONUtils.toJsonString(applicationIds));
}
View on GitHub (pinned to 02eac45a1b)
Solutions
- Check taskParams JSON against KubeflowParameters.checkParameters() rules and fill the missing fields in the UI.
- Ensure the task is bound to a properly configured K8s cluster so getK8sTaskExecutionContext().getConfigYaml() is populated.
- Re-save the task node to regenerate params in the current schema.
- Inspect worker logs for a NullPointerException at init to distinguish schema issues from missing cluster context.
Example fix
// before
{"name":"my-pipeline"}
// after
{"name":"my-pipeline","namespace":"kubeflow","resourceYaml":"apiVersion: ..."} Defensive patterns
Strategy: validation
Validate before calling
KubeflowParameters p = JSONUtils.parseObject(taskParamsJson, KubeflowParameters.class);
if (p == null || !p.checkParameters())
throw new IllegalArgumentException("invalid kubeflow params: " + taskParamsJson);
// also ensure cluster context is attached
if (k8sTaskExecutionContext == null || k8sTaskExecutionContext.getConfigYaml() == null)
throw new IllegalStateException("task is not bound to a K8s cluster context"); Type guard
static boolean kubeflowParamsReady(String taskParamsJson, K8sTaskExecutionContext ctx) {
KubeflowParameters p = JSONUtils.parseObject(taskParamsJson, KubeflowParameters.class);
return p != null && p.checkParameters()
&& ctx != null && ctx.getConfigYaml() != null;
} Try / catch
try {
kubeflowTask.init();
} catch (TaskException e) {
if (e.getMessage().contains("params is not valid")) {
log.error("kubeflow params missing required fields; fix task definition", e);
}
throw e;
} catch (NullPointerException e) {
log.error("K8s task execution context missing - bind task to a configured cluster", e);
} Prevention
- Provide the resource YAML and required fields in the kubeflow task definition.
- Attach the task to an environment whose K8s cluster config is populated.
- Re-save nodes after upgrading to regenerate params in the current schema.
- Validate params and cluster context in CI before deploying workflows.
When it happens
Trigger: init() runs and kubeflowParameters.checkParameters() returns false — required kubeflow params (e.g. the resource YAML content/name/namespace) are missing or empty; alternatively getK8sTaskExecutionContext() is null so setClusterYAML throws NPE inside init.
Common situations: Kubeflow task saved without the YAML definition or required fields, the cluster's K8s execution context (configYaml) missing because the task is not attached to a K8s cluster configured in the environment, or params JSON from an older version lacking new required fields.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- K8S task params is not valid
- jupyter task params is not valid
- Kubeflow task submit command failed
- Kubeflow task write yaml file failed
- 120034
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/acc65c42b0f6757f.
Report an issue: GitHub.