{"record":{"id":"b403001dba389b4d","repo":"apache/dolphinscheduler","slug":"create-alert-group-error","errorCode":"CREATE_ALERT_GROUP_ERROR","errorMessage":"CREATE_ALERT_GROUP_ERROR","messagePattern":"CREATE_ALERT_GROUP_ERROR","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java","lineNumber":170,"sourceCode":"        AlertGroup alertGroup = new AlertGroup();\n        Date now = new Date();\n\n        alertGroup.setGroupName(groupName);\n        alertGroup.setAlertInstanceIds(alertInstanceIds);\n        alertGroup.setDescription(desc);\n        alertGroup.setCreateTime(now);\n        alertGroup.setUpdateTime(now);\n        alertGroup.setCreateUserId(loginUser.getId());\n\n        // insert\n        try {\n            int insert = alertGroupDao.insert(alertGroup);\n            if (insert > 0) {\n                log.info(\"Create alert group complete, groupName:{}\", alertGroup.getGroupName());\n                return alertGroup;\n            }\n            log.error(\"Create alert group error, groupName:{}\", alertGroup.getGroupName());\n            throw new ServiceException(Status.CREATE_ALERT_GROUP_ERROR);\n        } catch (DuplicateKeyException ex) {\n            log.error(\"Create alert group error, groupName:{}\", alertGroup.getGroupName(), ex);\n            throw new ServiceException(Status.ALERT_GROUP_EXIST);\n        }\n    }\n\n    /**\n     * updateWorkflowInstance alert group\n     *\n     * @param loginUser login user\n     * @param id alert group id\n     * @param groupName group name\n     * @param desc description\n     * @param alertInstanceIds alertInstanceIds\n     * @return update result code\n     */\n    @Override\n    public AlertGroup updateAlertGroupById(User loginUser, int id, String groupName, String desc,","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java#L152-L188","documentation":"Thrown in createAlertGroup when alertGroupDao.insert either returns 0 rows or throws an exception, meaning the new alert group could not be persisted (e.g., DB constraint violation, connection failure, or duplicate group name).","triggerScenarios":"Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the group name does not already exist; group names must be unique.","Inspect server logs and database health for the underlying insert failure.","Retry the creation after fixing the data or database issue."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}