{"record":{"id":"24502d8008182367","repo":"apache/dolphinscheduler","slug":"130003","errorCode":"130003","errorMessage":"task group status error","messagePattern":"task group status error","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java","lineNumber":144,"sourceCode":"            log.warn(\"Parameter name can ot be null.\");\n            throw new ServiceException(Status.NAME_NULL);\n        }\n        if (groupSize <= 0) {\n            log.warn(\"Parameter task group size is must bigger than 1.\");\n            throw new ServiceException(Status.TASK_GROUP_SIZE_ERROR);\n        }\n        Long exists = taskGroupMapper.selectCount(new QueryWrapper<TaskGroup>().lambda()\n                .eq(TaskGroup::getName, name)\n                .eq(TaskGroup::getUserId, loginUser.getId())\n                .ne(TaskGroup::getId, id));\n\n        if (exists > 0) {\n            log.error(\"Task group with the same name already exists.\");\n            throw new ServiceException(Status.TASK_GROUP_NAME_EXSIT);\n        }\n        if (taskGroup.getStatus() != Flag.YES) {\n            log.warn(\"Task group has been closed, taskGroupId:{}.\", id);\n            throw new ServiceException(Status.TASK_GROUP_STATUS_ERROR);\n        }\n        taskGroup.setGroupSize(groupSize);\n        taskGroup.setDescription(description);\n        taskGroup.setUpdateTime(new Date());\n        if (StringUtils.isNotEmpty(name)) {\n            taskGroup.setName(name);\n        }\n        if (taskGroupMapper.updateById(taskGroup) <= 0) {\n            log.error(\"Update task group error, taskGroupId:{}.\", id);\n            throw new ServiceException(Status.UPDATE_TASK_GROUP_ERROR);\n        }\n        log.info(\"Update task group complete, taskGroupId:{}.\", id);\n        return taskGroup;\n    }\n\n    @Override\n    public PageInfo<TaskGroup> queryAllTaskGroup(User loginUser, String name, Integer status, int pageNo,\n                                                 int pageSize) {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java#L126-L162","documentation":"updateTaskGroup refuses to modify a task group whose status is not Flag.YES (i.e., the group has been closed/disabled), throwing Status.TASK_GROUP_STATUS_ERROR (code 130003). Closed groups are immutable until reopened.","triggerScenarios":"POST /task-group/update-or-create (update path) targeting a group whose t_ds_task_group.status is 0 (closed), typically after closeTaskGroup was called on it.","commonSituations":"Automations updating groups without checking their status; a group closed by an admin while a user still edits it in a stale UI form; scripts that close then try to resize groups.","solutions":["Reopen the task group (set status back to yes/open) before updating it.","Check group status via the API before issuing updates and skip closed groups.","Create a new active group instead of editing the closed one."],"exampleFix":"// before\nupdateTaskGroup(user, closedGroupId, name, desc, size); // fails, group closed\n// after\nif (apiClient.getTaskGroup(id).getStatus() == Flag.YES) {\n    updateTaskGroup(user, id, name, desc, size);\n} else {\n    apiClient.openTaskGroup(id);\n    updateTaskGroup(user, id, name, desc, size);\n}","handlingStrategy":"try-catch","validationCode":"TaskGroup g = api.getTaskGroup(id);\nif (g.getStatus() != Flag.YES) { api.openTaskGroup(id); /* or skip */ }","typeGuard":null,"tryCatchPattern":"try { api.updateTaskGroup(u, id, name, desc, size); }\ncatch (ServiceException e) { if (e.getCode() == 130003) { api.openTaskGroup(id); retry(); } }","preventionTips":["Check group status before any update","Refresh stale UI forms before saving edits","Alert operators when automations target closed groups"],"tags":["task-group","invalid-state","status"],"backgroundTag":"invalid-state-transition","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}