{"record":{"id":"a7f0d3b358de258f","repo":"apache/dolphinscheduler","slug":"execute-dvc-task-failed","errorCode":null,"errorMessage":"Execute dvc task failed","messagePattern":"Execute dvc task failed","errorType":"exception","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":79,"sourceCode":"    @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);\n        } catch (Exception e) {\n            log.error(\"dvc task error\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"Execute dvc task failed\", e);\n        }\n    }\n\n    @Override\n    public void cancel() throws TaskException {\n        // cancel process\n        try {\n            shellCommandExecutor.cancelApplication();\n        } catch (Exception e) {\n            throw new TaskException(\"cancel application error\", e);\n        }\n    }\n\n    public String buildCommand() {\n        String command = \"\";\n        String taskType = parameters.getDvcTaskType();\n        if (taskType.equals(DvcConstants.DVC_TASK_TYPE.UPLOAD)) {\n            command = buildUploadCommond();","sourceCodeStart":61,"sourceCodeEnd":97,"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#L61-L97","documentation":"Catch-all in DvcTask.handle: any non-interrupt exception while building/running the shell command (script generation, shell interceptor setup, IO problems, non-managed subprocess failures) is logged, sets exit code failure, and is rethrown as TaskException 'Execute dvc task failed' with the original cause.","triggerScenarios":"handle() called and any Exception other than InterruptedException escapes: ShellInterceptorBuilderFactory failure, IO errors writing the temp script, command not found / non-zero dvc exit surfaced by the executor, or parameters.dealOutParam NPEs.","commonSituations":"dvc/git not installed on the worker host; worker lacks git credentials for the DVC repository; remote store (S3 etc.) credentials missing; disk full when writing output; malformed command built from empty parameters.","solutions":["Inspect the wrapped cause in the worker log — it identifies the concrete failure (missing binary, git auth, IO).","Verify dvc and git are installed and on PATH on the worker, and git credentials are configured for the private repository.","Verify remote storage credentials (e.g. AWS creds for S3 store URL) on the worker environment.","Re-run with dvc CLI manually on the worker host to reproduce outside the scheduler."],"exampleFix":"// before: worker missing dvc -> command fails\n// worker host\n// after\npip install dvc[s3] && git --version && dvc version","handlingStrategy":"try-catch","validationCode":"// precheck on the worker host before running DVC tasks\nboolean ok = isOnPath(\"dvc\") && isOnPath(\"git\")\n          && hasGitCredentials(params.getDvcRepository())\n          && hasStoreCredentials(params.getDvcStoreUrl());","typeGuard":null,"tryCatchPattern":"try {\n    dvcTask.handle(null);\n} catch (TaskException e) {\n    log.error(\"DVC task failed; cause=\", e.getCause()); // root cause identifies missing binary/cred/IO\n}","preventionTips":["Install dvc and git on every worker image.","Pre-configure git credentials and remote store credentials on workers.","Ensure adequate disk space in the worker working directory.","Validate parameters so buildCommand never assembles an empty/partial command."],"tags":["dvc","shell-execution","task-failed","worker","git"],"backgroundTag":"command-not-found","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"}