apache/dolphinscheduler · warning · TaskException
cancel application error
Error message
cancel application error
What it means
cancelApplication wraps any exception from shellCommandExecutor.cancelApplication() into TaskException('cancel application error'). The attempt to kill the underlying shell process / Yarn application failed.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractYarnTask.java:93
// todo
@Override
public void trackApplicationStatus() throws TaskException {
}
/**
* cancel application
*
* @throws TaskException exception
*/
@Override
public void cancelApplication() throws TaskException {
// cancel process
try {
shellCommandExecutor.cancelApplication();
} catch (Exception e) {
throw new TaskException("cancel application error", e);
}
}
/**
* get application ids
* @return
* @throws TaskException
*/
@Override
public List<String> getApplicationIds() throws TaskException {
return LogUtils.getAppIds(taskRequest.getLogPath(), taskRequest.getAppInfoPath(),
PropertyUtils.getString(APPID_COLLECT, DEFAULT_COLLECT_WAY));
}
/**
* Get the script used to bootstrap the task
*/
protected abstract String getScript();View on GitHub (pinned to 02eac45a1b)
Solutions
- Check the wrapped cause; 'no such process' races are harmless and can be ignored
- Verify worker kill configuration (sudo permissions for the tenant user / KillProcessID)
- Ensure shellCommandExecutor state is intact (worker didn't restart mid-task)
- Clean up orphaned YARN applications manually if the OS kill failed
- Retry cancellation or use YARN kill application for the running app
Defensive patterns
Strategy: try-catch
Try / catch
try {
task.cancelApplication();
} catch (TaskException e) {
if (e.getCause() != null && e.getCause().getMessage() != null
&& e.getCause().getMessage().contains("No such process")) {
log.info("Process already exited; cancel is a no-op");
} else {
log.warn("Cancel failed, verify no orphaned YARN application", e);
}
} Prevention
- Configure worker kill permissions (sudo rules for tenant users)
- Avoid worker restarts mid-task; they break PID tracking
- After failed cancels, verify YARN applications and kill orphans manually
- Expect races where the process exits just before cancel
When it happens
Trigger: shellCommandExecutor.cancelApplication() throws while killing the process tree — the process already exited, the kill command (kill/pkill, sudo) fails, or an IO error occurs.
Common situations: User cancels a task whose process already terminated (race); worker lacks permission to kill the process owner's processes (non-root sudo config); PID file lost after worker restart.
Related errors
- cancel application error
- cancel application error
- Failed to cancel job run!
- The current yarn task has been interrupted
- Execute task failed
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/2d69c20b46469aef.
Report an issue: GitHub.