{"record":{"id":"5637570050f43317","repo":"apache/dolphinscheduler","slug":"jupyter-task-params-is-not-valid","errorCode":null,"errorMessage":"jupyter task params is not valid","messagePattern":"jupyter task params is not valid","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java","lineNumber":77,"sourceCode":"\n    @Override\n    public List<String> getApplicationIds() throws TaskException {\n        return Collections.emptyList();\n    }\n\n    @Override\n    public void init() {\n\n        jupyterParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), JupyterParameters.class);\n        log.info(\"Initialize jupyter task params {}\", JSONUtils.toPrettyJsonString(jupyterParameters));\n\n        if (null == jupyterParameters) {\n            log.error(\"jupyter params is null\");\n            return;\n        }\n\n        if (!jupyterParameters.checkParameters()) {\n            throw new RuntimeException(\"jupyter task params is not valid\");\n        }\n    }\n\n    // todo split handle to submit and track\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))\n                    .appendScript(buildCommand());\n\n            TaskResponse response = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(response.getExitStatusCode());\n            setAppIds(String.join(TaskConstants.COMMA, getApplicationIds()));\n            setProcessId(response.getProcessId());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current Jupyter task has been interrupted\", e);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java#L59-L95","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the jupyter task definition and fill in all required fields (notebook path, and env name/requirements per selected mode).","Check JupyterParameters.checkParameters() to see exactly which field fails and validate that value in task params JSON.","Re-save the workflow so the serialized taskParams JSON is regenerated with current UI fields.","Confirm the conda env or requirements file referenced actually exists."],"exampleFix":"// before (task params JSON)\n{\"notebookPath\":\"\",\"condaEnvName\":\"myenv\"}\n// after\n{\"notebookPath\":\"/mnt/notebooks/analysis.ipynb\",\"condaEnvName\":\"myenv\"}","handlingStrategy":"validation","validationCode":"// caller-side check before the task runs\nJupyterParameters p = JSONUtils.parseObject(taskParams, JupyterParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"invalid jupyter task params: \" + taskParams);\n}","typeGuard":"static boolean hasValidJupyterParams(String taskParamsJson) {\n    JupyterParameters p = JSONUtils.parseObject(taskParamsJson, JupyterParameters.class);\n    return p != null && p.checkParameters();\n}","tryCatchPattern":"try {\n    jupyterTask.init();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"params is not valid\")) {\n        log.error(\"fix jupyter task definition fields and re-save the workflow\", e);\n    }\n    throw e;\n}","preventionTips":["Fill notebook path and env/requirements fields matching the selected execution mode.","Re-save workflow nodes after upgrading the plugin so params match the new schema.","Unit-test checkParameters() against your task templates.","Never hand-edit taskParams JSON without validating against the parameter class."],"tags":["jupyter","parameter-validation","task-config"],"backgroundTag":"schema-validation-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}