{"record":{"id":"2601022a408d1a22","repo":"apache/dolphinscheduler","slug":"mlflow-task-params-is-not-valid","errorCode":null,"errorMessage":"MLFlow task params is not valid","messagePattern":"MLFlow task params is not valid","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-mlflow/src/main/java/org/apache/dolphinscheduler/plugin/task/mlflow/MlflowTask.java","lineNumber":95,"sourceCode":"        String versionString;\n        if (StringUtils.isEmpty(version)) {\n            versionString = \"\";\n        } else if (GIT_CHECK_PATTERN.matcher(repository).find()) {\n            versionString = String.format(\"--version=%s\", version);\n        } else {\n            versionString = \"\";\n        }\n        return versionString;\n    }\n\n    @Override\n    public void init() {\n\n        mlflowParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), MlflowParameters.class);\n\n        log.info(\"Initialize MLFlow task params {}\", JSONUtils.toPrettyJsonString(mlflowParameters));\n        if (mlflowParameters == null || !mlflowParameters.checkParameters()) {\n            throw new RuntimeException(\"MLFlow task params is not valid\");\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // construct process\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(getParamsMap()))\n                    .appendScript(buildCommand());\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            int exitCode;\n            if (mlflowParameters.getIsDeployDocker()) {\n                exitCode = checkDockerHealth();\n            } else {\n                exitCode = commandExecuteResult.getExitStatusCode();\n            }","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-mlflow/src/main/java/org/apache/dolphinscheduler/plugin/task/mlflow/MlflowTask.java#L77-L113","documentation":"MlflowTask.init() deserializes taskRequest.getTaskParams() into MlflowParameters and validates with checkParameters(). If parsing yields null or validation fails, it throws RuntimeException('MLFlow task params is not valid') to stop initialization before job submission.","triggerScenarios":"taskRequest.getTaskParams() is empty/malformed JSON (parseObject returns null), or MlflowParameters.checkParameters() returns false due to missing required fields (e.g. deploy model key, deploy mode).","commonSituations":"MLflow task node saved with required fields blank; params JSON corrupted by API/workflow import; a DolphinScheduler upgrade changed required MlflowParameters fields so old task definitions now fail validation.","solutions":["Open the MLflow task node and fill in all required parameters (deploy model key with runs:/ or models:/ prefix, deploy mode, etc.).","Validate the stored task params JSON is well-formed and matches MlflowParameters fields.","Compare the definition against MlflowParameters.checkParameters() to see which required checks fail.","After an upgrade, re-save legacy MLflow task definitions to include newly required fields."],"exampleFix":"// before (task params JSON)\n{\"deployMode\":\"local\"}\n// after\n{\"deployMode\":\"local\",\"deployModelKey\":\"runs:/1234/model\",\"mlflowTaskType\":\"MLflow Projects\",\"params\":{}}","handlingStrategy":"validation","validationCode":"MlflowParameters p = JSONUtils.parseObject(taskParams, MlflowParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"MLFlow task params invalid: required fields missing\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (RuntimeException e) {\n    log.error(\"MLFlow params rejected: {}\", e.getMessage());\n    // fix task definition, do not blind-retry\n}","preventionTips":["Fill all required MLflow task fields (deployModelKey, deployMode, mlflowTaskType) before saving.","Validate params JSON after workflow imports or API-driven task creation.","Re-save legacy MLflow tasks after DolphinScheduler upgrades.","Verify deployModelKey uses runs:/ or models:/ to pass checkParameters."],"tags":["mlflow","task-params","validation","dolphinscheduler"],"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"}