apache/dolphinscheduler · error · TaskException
cancel application error
Error message
cancel application error
What it means
JupyterTask.cancelApplication() wraps any exception from shellCommandExecutor.cancelApplication() (which kills the spawned jupyter process) into TaskException 'cancel application error'. It fires during task cancellation when the underlying process handle cannot be signalled or destroyed.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java:225
}
String others = jupyterParameters.getOthers();
if (StringUtils.isNotEmpty(others)) {
args.add(others);
}
args.add(JupyterConstants.INJECT_PATHS);
args.add(JupyterConstants.PROGRESS_BAR);
return args;
}
@Override
public void cancelApplication() throws TaskException {
// cancel process
try {
shellCommandExecutor.cancelApplication();
} catch (Exception e) {
throw new TaskException("cancel application error", e);
}
}
@Override
public AbstractParameters getParameters() {
return jupyterParameters;
}
}
View on GitHub (pinned to 02eac45a1b)
Solutions
- Inspect the wrapped stack trace; if the process already exited the cancel race is benign and can be retried/ignored.
- Verify the worker user can signal child processes (especially in Docker/Kubernetes containers).
- Check for orphaned jupyter/nbconvert processes on the worker and kill them manually.
- Upgrade to a version where cancelApplication handles already-dead processes gracefully.
Example fix
// before
} catch (Exception e) {
throw new TaskException("cancel application error", e);
}
// after
} catch (Exception e) {
log.warn("failed to cancel jupyter application, process may already be dead", e);
throw new TaskException("cancel application error: " + e.getMessage(), e);
} Defensive patterns
Strategy: try-catch
Type guard
static boolean isBenignCancelError(TaskException e) {
Throwable c = e.getCause();
return c != null && (c.getMessage() != null && c.getMessage().contains("No such process"));
} Try / catch
try {
jupyterTask.cancelApplication();
} catch (TaskException e) {
if (isBenignCancelError(e)) {
log.info("process already terminated; cancel is a no-op");
} else {
log.warn("failed to cancel jupyter process", e);
}
} Prevention
- Run all tasks and the worker under the same user/container security context so kills are permitted.
- Avoid container runtimes that strip kill capabilities (SIGTERM/SIGKILL) from the worker.
- Monitor for zombie jupyter processes and clean them periodically.
- Treat cancel races (process already exited) as expected in retry/kill logic.
When it happens
Trigger: Task is being killed and shellCommandExecutor.cancelApplication() throws — process already exited, PID no longer exists, OS permission denial sending the kill signal, or an internal executor exception during cancel.
Common situations: Killing a task whose jupyter process already finished (race), worker user lacking permission to kill a process started under another user/container, zombie processes, or OS-level restrictions in containers without SIGKILL capability.
Related errors
- cancel application error
- cancel application error
- Execute jupyter task failed
- no master server available
- Backfill workflow failed: %s
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/fbd2cb54c61bb9c5.
Report an issue: GitHub.