{"record":{"id":"407bd30900b33330","repo":"apache/dolphinscheduler","slug":"execute-linkis-task-failed","errorCode":null,"errorMessage":"Execute Linkis task failed","messagePattern":"Execute Linkis task failed","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java","lineNumber":99,"sourceCode":"        try {\n            // construct process\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))\n                    .appendScript(buildCommand());\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setAppIds(findTaskId(commandExecuteResult.getResultString()));\n            setProcessId(commandExecuteResult.getProcessId());\n            linkisParameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current Linkis task has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current Linkis task has been interrupted\", e);\n        } catch (Exception e) {\n            log.error(\"Linkis task error\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"Execute Linkis task failed\", e);\n        }\n    }\n\n    @Override\n    public void trackApplicationStatus() throws TaskException {\n        initTaskId();\n        try {\n            List<String> args = new ArrayList<>();\n            args.add(Constants.SHELL_CLI_OPTIONS);\n            args.add(Constants.STATUS_OPTIONS);\n            args.add(taskId);\n            String command = String.join(Constants.SPACE, args);\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(command);\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);\n            String status = findStatus(commandExecuteResult.getResultString());\n            LinkisJobStatus jobStatus = LinkisJobStatus.convertFromJobStatusString(status);\n            switch (jobStatus) {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java#L81-L117","documentation":"Generic failure wrapper in LinkisTask.submitApplication(): any Exception thrown while building or running the Linkis command (other than InterruptedException) is logged as 'Linkis task error', exit status is set to failure, and rethrown as TaskException('Execute Linkis task failed').","triggerScenarios":"ShellCommandExecutor.run() fails (command not found, non-zero exit, process start error), linkisParameters.dealOutParam() throws on malformed output params, or command construction throws.","commonSituations":"linkis-cli binary missing from PATH on the worker; bad parameters produce an invalid shell command; the Linkis job fails at runtime with non-zero exit code; output param parsing fails.","solutions":["Read the chained 'Linkis task error' log entry and underlying stack trace to find the real cause.","Verify the linkis-cli executable exists and is on PATH for the worker's execution user.","Reproduce the built shell command manually on the worker to see the actual CLI error output.","Fix the task parameters or Linkis job configuration that caused the underlying failure, then rerun."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    task.submitApplication();\n} catch (TaskException e) {\n    log.error(\"Linkis submission failed\", e.getCause());\n    // inspect cause: CLI missing, bad params, or job runtime failure\n}","preventionTips":["Pre-install linkis-cli on all worker images and verify it is on PATH.","Smoke-test the generated command manually on a worker.","Validate task params before submission to avoid malformed commands.","Check dealOutParam expectations against your Linkis version's output."],"tags":["linkis","shell-executor","task-failure","execution"],"backgroundTag":"command-execution-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"}