apache/dolphinscheduler · error · BaseException
The TaskExecutor id ${taskInstanceId} is not exist.
Error message
The TaskExecutor id ${taskInstanceId} is not exist. What it means
The lifecycle event reporter's channel runner (run -> handleTaskExecutionEventChannel) looks up the ITaskExecutor for a pending event's taskInstanceId before reporting it to the master. If the event is still pending/retrying but the executor is no longer in the repository, it throws BaseException "The TaskExecutor id %d is not exist." — the event has no owner to report for.
Source
Thrown at dolphinscheduler-task-executor/src/main/java/org/apache/dolphinscheduler/task/executor/eventbus/TaskExecutorLifecycleEventRemoteReporter.java:206
log.warn("TaskExecutor is not exists: {}", taskExecutorId);
}
}
private void handleTaskExecutionEventChannel(final ReportableTaskExecutorLifecycleEventChannel reportableTaskExecutorLifecycleEventChannel) {
if (reportableTaskExecutorLifecycleEventChannel.isEmpty()) {
return;
}
while (!reportableTaskExecutorLifecycleEventChannel.isEmpty()) {
final IReportableTaskExecutorLifecycleEvent headEvent = reportableTaskExecutorLifecycleEventChannel.peek();
try (
final TaskExecutorMDCUtils.MDCAutoClosable ignore =
TaskExecutorMDCUtils.logWithMDC(headEvent.getTaskInstanceId())) {
try {
if (isTaskExecutorEventNeverSent(headEvent) || isRetryIntervalExceeded(headEvent)) {
final Optional<ITaskExecutor> taskExecutorOptional =
taskExecutorRepository.get(headEvent.getTaskInstanceId());
if (!taskExecutorOptional.isPresent()) {
throw new BaseException(String.format("The TaskExecutor id %d is not exist.",
headEvent.getTaskInstanceId()));
}
final String masterAddress =
taskExecutorOptional.get().getTaskExecutionContext().getWorkflowInstanceHost();
taskExecutorEventRemoteReporterClient.reportTaskExecutionEventToMaster(masterAddress,
headEvent);
continue;
}
if (log.isDebugEnabled()) {
log.debug(
"The ReportableTaskExecutorLifecycleEvent: {} latest send time: {} doesn't exceeded retry interval",
headEvent,
headEvent.getLatestReportTime());
}
break;
} catch (Exception ex) {
log.error("Send TaskExecutionEvent: {} to master error will retry after {} mills",
headEvent,View on GitHub (pinned to 02eac45a1b)
Solutions
- Verify events are drained/reported before removing executors from the repository
- Investigate why reporting failed repeatedly until the executor was removed (network to master, master down)
- Reduce event backlog by ensuring the master address is reachable and the reporter client healthy
- On occurrence, treat the stale event as droppable or purge orphaned events after executor removal
Defensive patterns
Strategy: try-catch
Validate before calling
if (taskExecutorRepository.get(event.getTaskInstanceId()).isEmpty()) {
// event is stale: drop or move to dead-letter instead of reporting
return;
} Try / catch
try {
reporterChannel.run();
} catch (BaseException e) {
if (e.getMessage().contains("is not exist")) {
log.warn("Dropping stale lifecycle event; executor removed");
} else throw e;
} Prevention
- Remove an executor from the repository only after its event queue is drained
- Keep the master reachable so events don't retry past executor lifetime
- Purge/expire orphaned events when executors are cleaned up
When it happens
Trigger: A task execution event was queued (or is being retried after failures) and, before it is successfully reported, the corresponding task executor was removed from taskExecutorRepository (task finished/killed/cleaned up), so repository.get(taskInstanceId) returns empty.
Common situations: Master restart or task cleanup racing with a backlog of unreported events; events retained past the task's lifecycle; memory pressure evicting executors while retrying failed reports.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- ${this} has already started
- DELETE_QUEUE_BY_ID_ERROR
- "Take over task: " + taskExecution.getName() + " from execut
- "Pause task: " + taskExecution.getName() + " from executor f
- "Kill task: " + taskExecution.getName() + " from executor fa
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/0147f1eae8322be5.
Report an issue: GitHub.