apache/dolphinscheduler · error · RuntimeException

jupyter task params is not valid

Error message

jupyter task params is not valid

What it means

JupyterTask.init() validates the parsed JupyterParameters via checkParameters(); if required fields are missing/invalid it throws RuntimeException 'jupyter task params is not valid'. This fails the task immediately at initialization, before any conda/pip or jupyter process is started.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java:77

    @Override
    public List<String> getApplicationIds() throws TaskException {
        return Collections.emptyList();
    }

    @Override
    public void init() {

        jupyterParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), JupyterParameters.class);
        log.info("Initialize jupyter task params {}", JSONUtils.toPrettyJsonString(jupyterParameters));

        if (null == jupyterParameters) {
            log.error("jupyter params is null");
            return;
        }

        if (!jupyterParameters.checkParameters()) {
            throw new RuntimeException("jupyter task params is not valid");
        }
    }

    // todo split handle to submit and track
    @Override
    public void handle(TaskCallBack taskCallBack) throws TaskException {
        try {
            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
                    .properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))
                    .appendScript(buildCommand());

            TaskResponse response = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);
            setExitStatusCode(response.getExitStatusCode());
            setAppIds(String.join(TaskConstants.COMMA, getApplicationIds()));
            setProcessId(response.getProcessId());
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            log.error("The current Jupyter task has been interrupted", e);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open the jupyter task definition and fill in all required fields (notebook path, and env name/requirements per selected mode).
  2. Check JupyterParameters.checkParameters() to see exactly which field fails and validate that value in task params JSON.
  3. Re-save the workflow so the serialized taskParams JSON is regenerated with current UI fields.
  4. Confirm the conda env or requirements file referenced actually exists.

Example fix

// before (task params JSON)
{"notebookPath":"","condaEnvName":"myenv"}
// after
{"notebookPath":"/mnt/notebooks/analysis.ipynb","condaEnvName":"myenv"}
Defensive patterns

Strategy: validation

Validate before calling

// caller-side check before the task runs
JupyterParameters p = JSONUtils.parseObject(taskParams, JupyterParameters.class);
if (p == null || !p.checkParameters()) {
    throw new IllegalArgumentException("invalid jupyter task params: " + taskParams);
}

Type guard

static boolean hasValidJupyterParams(String taskParamsJson) {
    JupyterParameters p = JSONUtils.parseObject(taskParamsJson, JupyterParameters.class);
    return p != null && p.checkParameters();
}

Try / catch

try {
    jupyterTask.init();
} catch (RuntimeException e) {
    if (e.getMessage().contains("params is not valid")) {
        log.error("fix jupyter task definition fields and re-save the workflow", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Task init runs when jupyterParameters != null but jupyterParameters.checkParameters() returns false — i.e. one of the required jupyter parameters (notebook path, conda env name, pip requirements file, etc.) is blank or inconsistent with the chosen execution mode.

Common situations: Notebook path left empty, 'use venv/conda env' selected with no env name given, pip requirements mode chosen with empty requirements, or an older UI/template producing params that a newer plugin version rejects.

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


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