apache/dolphinscheduler · error · ServiceException

NOT_ALLOW_TO_DELETE_DEFAULT_ALARM_GROUP

NOT_ALLOW_TO_DELETE_DEFAULT_ALARM_GROUP

Error message

NOT_ALLOW_TO_DELETE_DEFAULT_ALARM_GROUP

What it means

Thrown by deleteAlertGroupById when attempting to delete the built-in default alert group (id == 1). DolphinScheduler reserves this group because internal services rely on it, so it is protected from deletion.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java:239

    /**
     * delete alert group by id
     *
     * @param loginUser login user
     * @param id        alert group id
     * @return delete result code
     */
    @Override
    public void deleteAlertGroupById(User loginUser, int id) {

        // only admin can operate
        if (!canOperatorPermissions(loginUser, new Object[]{id}, AuthorizationType.ALERT_GROUP, ALERT_GROUP_DELETE)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

        // Not allow to delete the default alarm group ,because the module of service need to use it.
        if (id == 1) {
            log.warn("Not allow to delete the default alarm group.");
            throw new ServiceException(Status.NOT_ALLOW_TO_DELETE_DEFAULT_ALARM_GROUP);
        }

        // check exist
        AlertGroup alertGroup = alertGroupDao.queryById(id);
        if (alertGroup == null) {
            throw new ServiceException(Status.ALERT_GROUP_NOT_EXIST);
        }

        alertGroupDao.deleteById(id);
        log.info("Delete alert group complete, groupId:{}", id);
    }

    /**
     * verify group name exists
     *
     * @param groupName group name
     * @return check result code
     */

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Do not delete group id 1; delete only custom alert groups
  2. Filter out id==1 in bulk-delete scripts
  3. If the default group should not be used, create a new group and update alerts to reference it instead

Example fix

// before
for (AlertGroup g : groups) alertGroupService.deleteAlertGroupById(loginUser, g.getId());
// after
for (AlertGroup g : groups) {
    if (g.getId() != 1) alertGroupService.deleteAlertGroupById(loginUser, g.getId());
}
Defensive patterns

Strategy: validation

Validate before calling

if (id == 1) {
    throw new IllegalArgumentException("the default alarm group (id=1) cannot be deleted");
}

Prevention

When it happens

Trigger: Calling DELETE /alert-groups/1, i.e. any delete request targeting groupId 1 (the default alarm group).

Common situations: Cleanup scripts deleting all alert groups blindly; users confusing the default group with a disposable one; environment teardown automation iterating over all group IDs.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/7833e248cb7edff3. Report an issue: GitHub.