apache/dolphinscheduler · error · TaskException

cancel application error

Error message

cancel application error

What it means

SeatunnelTask.cancelApplication() delegates to shellCommandExecutor.cancelApplication() to kill the SeaTunnel process; any exception is rethrown as TaskException("cancel application error", e). It means the underlying process kill (e.g. destroy of the shell process tree via kill process id) failed.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/SeatunnelTask.java:126

    }

    @Override
    public void submitApplication() throws TaskException {

    }

    @Override
    public void trackApplicationStatus() throws TaskException {

    }

    @Override
    public void cancelApplication() throws TaskException {
        // cancel process
        try {
            shellCommandExecutor.cancelApplication();
        } catch (Exception e) {
            throw new TaskException("cancel application error", e);
        }
    }

    private String buildCommand() throws Exception {

        List<String> args = new ArrayList<>();
        args.add(SEATUNNEL_BIN_DIR + seatunnelParameters.getStartupScript());
        args.addAll(buildOptions());

        String command = String.join(" ", args);
        log.info("SeaTunnel task command: {}", command);

        return command;
    }

    protected List<String> buildOptions() throws Exception {
        List<String> args = new ArrayList<>();
        args.add(CONFIG_OPTIONS);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the chained cause: 'No such process' means the job already ended — safe to ignore and verify final status.
  2. Ensure the worker user owns or can signal the SeaTunnel process (same OS user, no su/permission mismatch).
  3. Retry the kill; for stuck JVM children use the kill process id logged by the task to kill manually.
  4. If recurring on worker restarts, check that task PIDs are being tracked/persisted correctly.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    task.cancelApplication();
} catch (TaskException e) {
    if (e.getCause() instanceof NoSuchProcessException || String.valueOf(e.getCause()).contains("No such process")) {
        log.info("SeaTunnel process already exited; cancel is a no-op");
    } else throw e;
}

Prevention

When it happens

Trigger: shellCommandExecutor.cancelApplication() throws — the recorded process id is stale/dead, the OS denies the kill (permission), or the executor's internal state is inconsistent because the process already exited.

Common situations: Killing a task right as the SeaTunnel process finishes (race on PID), worker user lacking rights to signal the process (different owner), PDS-based executors on Windows/limited environments where process handles are unavailable.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/8a0f699952f0bfbd. Report an issue: GitHub.