apache/dolphinscheduler · error · TaskException
Execute Linkis task failed
Error message
Execute Linkis task failed
What it means
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').
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java:99
try {
// construct process
IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
.properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))
.appendScript(buildCommand());
TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);
setExitStatusCode(commandExecuteResult.getExitStatusCode());
setAppIds(findTaskId(commandExecuteResult.getResultString()));
setProcessId(commandExecuteResult.getProcessId());
linkisParameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("The current Linkis task has been interrupted", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("The current Linkis task has been interrupted", e);
} catch (Exception e) {
log.error("Linkis task error", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("Execute Linkis task failed", e);
}
}
@Override
public void trackApplicationStatus() throws TaskException {
initTaskId();
try {
List<String> args = new ArrayList<>();
args.add(Constants.SHELL_CLI_OPTIONS);
args.add(Constants.STATUS_OPTIONS);
args.add(taskId);
String command = String.join(Constants.SPACE, args);
IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
.appendScript(command);
TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);
String status = findStatus(commandExecuteResult.getResultString());
LinkisJobStatus jobStatus = LinkisJobStatus.convertFromJobStatusString(status);
switch (jobStatus) {View on GitHub (pinned to 02eac45a1b)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try {
task.submitApplication();
} catch (TaskException e) {
log.error("Linkis submission failed", e.getCause());
// inspect cause: CLI missing, bad params, or job runtime failure
} Prevention
- 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.
When it happens
Trigger: ShellCommandExecutor.run() fails (command not found, non-zero exit, process start error), linkisParameters.dealOutParam() throws on malformed output params, or command construction throws.
Common situations: 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.
Related errors
- The current Linkis task has been interrupted
- track linkis status error
- cancel linkis task error
- Linkis task params is not valid
- linkis task id is null
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/407bd30900b33330.
Report an issue: GitHub.