{"record":{"id":"16753ceb22476ee6","repo":"pinpoint-apm/pinpoint","slug":"there-is-not-applicationid-checkername-usergroupid","errorCode":null,"errorMessage":"there is not applicationId/checkerName/userGroupId/threashold to insert alarm rule","messagePattern":"there is not applicationId/checkerName/userGroupId/threashold to insert alarm rule","errorType":"http","errorClass":"ResponseStatusException","httpStatus":400,"severity":"warning","filePath":"web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AlarmController.java","lineNumber":67,"sourceCode":"@RestController\n@RequestMapping(value={\"/api/alarmRule\", \"/api/application/alarmRule\"})\n@Validated\npublic class AlarmController {\n\n    public final static String USER_GROUP_ID_PARAMS = \"userGroupId\";\n    public final static String APPLICATION_ID_PARAMS = \"applicationId\";\n\n    private final AlarmService alarmService;\n\n    public AlarmController(AlarmService alarmService) {\n        this.alarmService = Objects.requireNonNull(alarmService, \"alarmService\");\n    }\n\n    @PreAuthorize(\"@naverPermissionEvaluator.hasAlarmPermission(#serviceName.getName(), #rule.getApplicationName(), T(com.navercorp.pinpoint.web.security.PermissionChecker).PERMISSION_ALARM_EDIT_ALARM_ONLY_MANAGER)\")\n    @PostMapping\n    public AlarmResponse insertRule(@ServiceParam ServiceName serviceName, @RequestBody Rule rule) {\n        if (Rule.isRuleInvalidForPost(rule)) {\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"there is not applicationId/checkerName/userGroupId/threashold to insert alarm rule\");\n        }\n        final String ruleId = alarmService.insertRule(rule);\n        return new AlarmResponse(Result.SUCCESS, ruleId);\n    }\n\n    @PreAuthorize(\"@naverPermissionEvaluator.hasAlarmPermission(#serviceName.getName(), #rule.getApplicationName(), T(com.navercorp.pinpoint.web.security.PermissionChecker).PERMISSION_ALARM_EDIT_ALARM_ONLY_MANAGER)\")\n    @DeleteMapping\n    public Response deleteRule(@ServiceParam ServiceName serviceName, @RequestBody Rule rule) {\n        if (StringUtils.isEmpty(rule.getRuleId())) {\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"there is not ruleId to delete alarm rule\");\n        }\n        alarmService.deleteRule(rule);\n        return SimpleResponse.ok();\n    }\n\n    @GetMapping(params = USER_GROUP_ID_PARAMS)\n    public List<Rule> getRulesByUserGroup(@ServiceParam ServiceName serviceName, @RequestParam(value = USER_GROUP_ID_PARAMS) @NotBlank String userGroupId) {\n        return alarmService.selectRuleByUserGroupId(userGroupId);","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AlarmController.java#L49-L85","documentation":"POST /alarmRule validates the submitted Rule body via Rule.isRuleInvalidForPost; if required fields (applicationId/applicationName, checkerName, and the rule content such as userGroupId/threshold) are missing, the API returns HTTP 400 with this message instead of creating the alarm rule.","triggerScenarios":"POSTing an alarm rule JSON with a missing applicationName, checkerName, userGroupId, or threshold fields — Rule.isRuleInvalidForPost returns true.","commonSituations":"Automation scripts posting minimal rule payloads; field renames between Pinpoint versions (e.g. applicationId vs applicationName); empty strings instead of values in the JSON body.","solutions":["Include applicationName, checkerName, userGroupId and threshold in the POST body","Compare the payload against the Rule class fields for your Pinpoint version","Send values as real strings/numbers, not empty strings or nulls"],"exampleFix":"// before\nPOST /alarmRule {\"checkerName\":\"ERROR_RATE\"}\n// after\nPOST /alarmRule {\"applicationName\":\"myApp\",\"checkerName\":\"ERROR_RATE\",\"userGroupId\":\"team1\",\"threshold\":10}","handlingStrategy":"validation","validationCode":"function isValidRuleForPost(r) { return r && r.applicationName && r.checkerName && r.userGroupId != null && r.threshold != null; }","typeGuard":"function isNonEmpty(v) { return typeof v === 'string' ? v.trim().length > 0 : v != null; }","tryCatchPattern":"try { ... } catch (HttpClientErrorException e) { if (e.getStatusCode().value() == 400) { log.error(\"Invalid alarm rule payload\", e); } else { throw e; } }","preventionTips":["Send the full Rule JSON, not partial fields","Compare payload fields to the Rule class of your Pinpoint version","Avoid empty strings in place of values"],"tags":["http-400","validation","alarm-rule","pinpoint"],"backgroundTag":"schema-validation-failed","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}