apache/dolphinscheduler · warning · ServiceException
130019
130019
Error message
The task group has been opened.
What it means
Thrown by startTaskGroup when the task group's status is already Flag.YES, i.e. it is already open/started. Starting an already-open group is rejected with Status.TASK_GROUP_STATUS_OPENED (code 130019).
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java:233
}
taskGroup.setStatus(Flag.NO);
if (taskGroupMapper.updateById(taskGroup) > 0) {
log.info("Task group close complete, taskGroupId:{}.", id);
} else {
log.error("Task group close error, taskGroupId:{}.", id);
}
}
@Override
public void startTaskGroup(User loginUser, int id) {
if (!canOperatorPermissions(loginUser, null, AuthorizationType.TASK_GROUP,
ApiFuncIdentificationConstant.TASK_GROUP_CLOSE)) {
throw new ServiceException(Status.NO_CURRENT_OPERATING_PERMISSION);
}
TaskGroup taskGroup = taskGroupMapper.selectById(id);
if (taskGroup.getStatus() == Flag.YES) {
log.info("Task group has been started, taskGroupId:{}.", id);
throw new ServiceException(Status.TASK_GROUP_STATUS_OPENED);
}
taskGroup.setStatus(Flag.YES);
taskGroup.setUpdateTime(new Date(System.currentTimeMillis()));
if (taskGroupMapper.updateById(taskGroup) > 0) {
log.info("Task group start complete, taskGroupId:{}.", id);
} else {
log.error("Task group start error, taskGroupId:{}.", id);
}
}
@Override
public void forceStartTask(User loginUser, int queueId) {
if (!canOperatorPermissions(loginUser, null, AuthorizationType.TASK_GROUP,
ApiFuncIdentificationConstant.TASK_GROUP_QUEUE_START)) {
throw new ServiceException(Status.NO_CURRENT_OPERATING_PERMISSION);
}
executorService.forceStartTaskInstance(loginUser, queueId);
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Query the group status first (GET /task-group/list-paging) and skip if already open.
- Treat code 130019 as success in idempotent retry paths.
- Refresh UI state before retrying.
- If it must be closed, call /task-group/close first.
Example fix
// before
taskGroupService.startTaskGroup(loginUser, id);
// after
try {
taskGroupService.startTaskGroup(loginUser, id);
} catch (ServiceException e) {
if (e.getCode() != 130019) throw e; // already open is acceptable
} Defensive patterns
Strategy: validation
Validate before calling
// Java: check status before starting
TaskGroup tg = taskGroupMapper.selectById(id);
if (tg != null && tg.getStatus() == Flag.YES) {
return; // already open
} Type guard
boolean isOpened(TaskGroup tg) {
return tg != null && tg.getStatus() == Flag.YES;
} Try / catch
try {
taskGroupService.startTaskGroup(loginUser, id);
} catch (ServiceException e) {
if (e.getCode() == 130019) {
log.info("Task group {} already open; treating as success", id);
return;
}
throw e;
} Prevention
- Fetch current status before any start call.
- Treat 'already opened' (130019) as success in idempotent retry paths.
- Guard against double submission in UIs and schedulers.
- Refresh cached task group state after failures.
When it happens
Trigger: Calling POST /task-group/start on a group that is already enabled; retrying a start request that already succeeded; concurrent start calls from multiple clients.
Common situations: Double-submitted forms; scheduled scripts that re-run a start step; stale UI showing the group as closed when it is open.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/d713dd17df86054a.
Report an issue: GitHub.