{"record":{"id":"b3bf1b78529fc59a","repo":"apache/dolphinscheduler","slug":"dvc-task-params-is-not-valid","errorCode":null,"errorMessage":"dvc task params is not valid","messagePattern":"dvc task params is not valid","errorType":"validation","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java","lineNumber":57,"sourceCode":"public class DvcTask extends AbstractTask {\n\n    private DvcParameters parameters;\n\n    private final ShellCommandExecutor shellCommandExecutor;\n\n    public DvcTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n        this.shellCommandExecutor = new ShellCommandExecutor(taskExecutionContext);\n    }\n\n    @Override\n    public void init() {\n\n        parameters = JSONUtils.parseObject(taskRequest.getTaskParams(), DvcParameters.class);\n        log.info(\"Initialize dvc task params {}\", JSONUtils.toPrettyJsonString(parameters));\n\n        if (parameters == null || !parameters.checkParameters()) {\n            throw new TaskException(\"dvc task params is not valid\");\n        }\n    }\n\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // construct process\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(buildCommand());\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setProcessId(commandExecuteResult.getProcessId());\n            parameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current DvcTask has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current DvcTask has been interrupted\", e);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java#L39-L75","documentation":"DvcTask.init parses taskParams into DvcParameters via JSONUtils and immediately validates them. If parsing yields null (bad/empty JSON) or DvcParameters.checkParameters() returns false (required fields like dvcTaskType, dvcRepository missing), a TaskException 'dvc task params is not valid' is thrown.","triggerScenarios":"init() called during task lifecycle with taskParams that deserialize to null or fail DvcParameters.checkParameters() — missing dvcTaskType, dvcRepository, dvcLoadSaveDataPath/dvcDataLocation/dvcVersion (for upload/download) or dvcStoreUrl (for init).","commonSituations":"Workflow saved with empty DVC node form; wrong task type selected so required fields were never filled; UI plugin/form mismatch after upgrading DolphinScheduler; hand-edited workflow JSON dropping required fields.","solutions":["Open the DVC task node in the UI and fill all required fields (task type, DVC repository, data path/location, version, or store URL for init).","Check checkParameters() in DvcParameters to see exactly which fields it requires, then supply them.","Validate the taskParams JSON stored for the task instance is non-empty and parseable.","If the form was hand-edited, regenerate it via the UI to get the correct parameter structure."],"exampleFix":"// before: missing dvcTaskType\n{\"localParams\":[],\"resourceList\":[]}\n// after\n{\"dvcTaskType\":\"UPLOAD\",\"dvcRepository\":\"https://github.com/x/repo.git\",\"dvcLoadSaveDataPath\":\"./data\",\"dvcDataLocation\":\"s3://bucket/data\",\"dvcVersion\":\"v1.0\",\"localParams\":[],\"resourceList\":[]}","handlingStrategy":"validation","validationCode":"DvcParameters p = JSONUtils.parseObject(taskParams, DvcParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"DVC params missing required fields (dvcTaskType, dvcRepository, ...)\");\n}","typeGuard":"boolean dvcParamsValid(String json) {\n    DvcParameters p = JSONUtils.parseObject(json, DvcParameters.class);\n    return p != null && p.checkParameters();\n}","tryCatchPattern":"try {\n    task.init();\n} catch (TaskException e) {\n    // surface a user-facing 'fix the DVC node form' message\n}","preventionTips":["Fill every required field in the DVC node UI form before saving.","Cross-check with DvcParameters.checkParameters() when hand-writing JSON.","Avoid editing workflow definition JSON directly.","Re-save DVC nodes after upgrading DolphinScheduler."],"tags":["dvc","task-params","validation","config","dolphinscheduler"],"backgroundTag":"missing-required-config-field","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"}