apache/dolphinscheduler · error · ServiceException
130002
130002
Error message
task group size error
What it means
createTaskGroup validates that groupSize is a positive integer; groupSize <= 0 fails with Status.TASK_GROUP_SIZE_ERROR (code 130002). The size defines how many task instances the group can hold concurrently, so a non-positive value is meaningless.
Source
Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java:90
@Autowired
private ExecutorService executorService;
@Override
@Transactional
public TaskGroup createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) {
requireProjectPerm(loginUser, projectCode, true);
if (checkDescriptionLength(description)) {
log.warn("Parameter description is too long.");
throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
}
if (name == null) {
log.warn("Parameter name can ot be null.");
throw new ServiceException(Status.NAME_NULL);
}
if (groupSize <= 0) {
log.warn("Parameter task group size is must bigger than 1.");
throw new ServiceException(Status.TASK_GROUP_SIZE_ERROR);
}
TaskGroup duplicate = taskGroupMapper.queryByName(loginUser.getId(), name);
if (duplicate != null) {
log.warn("Task group with the same name already exists, taskGroupName:{}.", duplicate.getName());
throw new ServiceException(Status.TASK_GROUP_NAME_EXSIT);
}
Date now = new Date();
TaskGroup taskGroup = TaskGroup.builder()
.name(name)
.projectCode(projectCode)
.description(description)
.groupSize(groupSize)
.userId(loginUser.getId())
.status(Flag.YES)
.createTime(now)
.updateTime(now)
.build();
View on GitHub (pinned to 02eac45a1b)
Solutions
- Pass a groupSize >= 1 (and sensibly small, e.g. within resource limits).
- Add client-side validation that groupSize is a positive integer.
- Fix upstream calculation that yields 0/negative sizes.
Example fix
// before int size = config.getSize(); // may be 0 createTaskGroup(user, projectCode, name, desc, size); // after int size = Math.max(1, config.getSize()); createTaskGroup(user, projectCode, name, desc, size);
Defensive patterns
Strategy: validation
Validate before calling
if (groupSize <= 0) {
throw new IllegalArgumentException("task group size must be >= 1");
} Try / catch
try { api.createTaskGroup(u, pc, name, desc, size); }
catch (ServiceException e) { if (e.getCode() == 130002) { size = Math.max(1, size); retry(); } } Prevention
- Use min=1 on size inputs in UIs and forms
- Never use size=0 to disable groups; use the status/close API
- Sanitize unbind/missing integers that default to 0
When it happens
Trigger: POST /task-group/update-or-create with groupSize = 0, negative, or an unparseable/absent int that binds to 0.
Common situations: UI defaults of 0 sent unchanged; config scripts computing size from a value that evaluates to 0; int overflow or type confusion when passing sizes from other systems.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/a36da91535d84d84.
Report an issue: GitHub.