apache/dolphinscheduler · error · ServiceException
10174
10174
Error message
delete worker group not exist
What it means
Thrown in WorkerGroupServiceImpl.deleteWorkerGroupById when workerGroupDao.queryById(id) returns null: the worker-group id being deleted does not exist in t_ds_worker_group, typically because it was already removed or the client passed a stale/nonexistent id.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java:322
return workerGroupPageDetail;
}).collect(Collectors.toList());
}
/**
* delete worker group by id
*
* @param id worker group id
*/
@Override
@Transactional
public void deleteWorkerGroupById(User loginUser, Integer id) {
if (!canOperatorPermissions(loginUser, null, AuthorizationType.WORKER_GROUP, WORKER_GROUP_DELETE)) {
throw new ServiceException(Status.USER_NO_OPERATION_PERM);
}
WorkerGroup workerGroup = workerGroupDao.queryById(id);
if (workerGroup == null) {
log.error("Worker group does not exist, workerGroupId:{}.", id);
throw new ServiceException(Status.DELETE_WORKER_GROUP_NOT_EXIST);
}
List<WorkflowInstanceSummaryDto> workflowInstances = workflowInstanceDao.queryByWorkerGroupNameAndStatus(
workerGroup.getName(),
WorkflowExecutionStatus.NOT_TERMINAL_STATES);
if (CollectionUtils.isNotEmpty(workflowInstances)) {
List<Integer> workflowInstanceIds =
workflowInstances.stream().map(WorkflowInstanceSummaryDto::getId).collect(Collectors.toList());
log.warn(
"Delete worker group failed because there are {} workflowInstances are using it, workflowInstanceIds:{}.",
workflowInstances.size(), workflowInstanceIds);
throw new ServiceException(Status.DELETE_WORKER_GROUP_BY_ID_FAIL, workflowInstances.size());
}
checkWorkerGroupDependencies(workerGroup);
workerGroupDao.deleteById(id);
boardCastToMasterThatWorkerGroupChanged();
View on GitHub (pinned to 02eac45a1b)
Solutions
- Refresh the worker group list and confirm the id still exists before deleting.
- Check the response of the prior delete call; the group may already be gone and this error is benign for idempotent cleanup.
- Correct the id in the script/UI call.
Example fix
// before: blind delete
DELETE /worker-groups/{id}
// after: check existence first
WorkerGroup g = workerGroupDao.queryById(id);
if (g != null) workerGroupService.deleteWorkerGroupById(loginUser, id); Defensive patterns
Strategy: validation
Validate before calling
WorkerGroup g = workerGroupDao.queryById(id); boolean exists = g != null;
Try / catch
try {
workerGroupService.deleteWorkerGroupById(loginUser, id);
} catch (ServiceException e) {
if (e.getCode() == 10174) { /* treat as already-deleted (idempotent) */ }
else throw e;
} Prevention
- Re-fetch the group list before each delete in scripts instead of caching ids.
- Make bulk cleanup idempotent: ignore 10174 as success.
- Avoid double-submit delete requests from UI clients.
When it happens
Trigger: Calling DELETE /worker-groups/{id} with an id that is absent from t_ds_worker_group (deleted by another user/session, wrong id, or UI stale after concurrent deletion).
Common situations: Double-clicking delete so the second request finds nothing; scripted cleanup reusing old ids; deleting across environments (test vs prod database) with copied ids.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/223576cb8321a676.
Report an issue: GitHub.