{"record":{"id":"9cfb06caedaeeb54","repo":"pinpoint-apm/pinpoint","slug":"there-is-not-ruleid-usergroupid-applicationid-chec","errorCode":null,"errorMessage":"There is not ruleId/userGroupId/applicationId/checkerName to publish alarm rule","messagePattern":"There is not ruleId/userGroupId/applicationId/checkerName to publish alarm rule","errorType":"http","errorClass":"ResponseStatusException","httpStatus":400,"severity":"warning","filePath":"web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AlarmController.java","lineNumber":97,"sourceCode":"        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);\n    }\n\n    @GetMapping(params = APPLICATION_ID_PARAMS)\n    public List<Rule> getRulesByApplication(@ServiceParam ServiceName serviceName, @RequestParam(value = APPLICATION_ID_PARAMS) @NotBlank String applicationName) {\n        return alarmService.selectRuleByApplicationName(applicationName);\n    }\n\n    @PreAuthorize(\"@naverPermissionEvaluator.hasAlarmPermission(#serviceName.getName(), #rule.getApplicationName(), T(com.navercorp.pinpoint.web.security.PermissionChecker).PERMISSION_ALARM_EDIT_ALARM_ONLY_MANAGER)\")\n    @PutMapping\n    public Response updateRule(@ServiceParam ServiceName serviceName, @RequestBody Rule rule) {\n        if (Rule.isRuleInvalid(rule)) {\n            throw new ResponseStatusException(\n                    HttpStatus.BAD_REQUEST,\n                    \"There is not ruleId/userGroupId/applicationId/checkerName to publish alarm rule\"\n            );\n        }\n        alarmService.updateRule(rule);\n        return SimpleResponse.ok();\n    }\n\n    @GetMapping(value = \"/checker\")\n    public List<String> getCheckerName(@ServiceParam ServiceName serviceName) {\n        return CheckerCategory.getNames();\n    }\n\n}\n","sourceCodeStart":79,"sourceCodeEnd":112,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AlarmController.java#L79-L112","documentation":"PUT /alarmRule validates the full Rule via Rule.isRuleInvalid before updating; if ruleId, userGroupId, applicationId/applicationName or checkerName are missing the update is rejected with HTTP 400. An update needs all identifying fields to locate and rewrite the rule.","triggerScenarios":"PUT /alarmRule with a body missing ruleId, userGroupId, applicationName/applicationId or checkerName.","commonSituations":"Partial-update clients sending only the changed field (the API does not support partial updates); renamed fields between versions; fetching a rule, mutating it, and dropping required fields.","solutions":["Send the complete Rule object including ruleId, applicationName, checkerName and userGroupId on PUT","GET the current rule first, modify only the desired field, then PUT the whole object","Verify field names match the Rule class of your Pinpoint version"],"exampleFix":"// before\nPUT /alarmRule {\"ruleId\":\"1723\",\"threshold\":20}\n// after\nPUT /alarmRule {\"ruleId\":\"1723\",\"applicationName\":\"myApp\",\"checkerName\":\"ERROR_RATE\",\"userGroupId\":\"team1\",\"threshold\":20}","handlingStrategy":"validation","validationCode":"const ok = rule && rule.ruleId && rule.applicationName && rule.checkerName && rule.userGroupId; if (!ok) throw new Error('PUT /alarmRule needs ruleId, applicationName, checkerName, userGroupId');","typeGuard":"function isCompleteRule(r) { return ['ruleId','applicationName','checkerName','userGroupId'].every(k => typeof r?.[k] === 'string' && r[k].length > 0); }","tryCatchPattern":"try { ... } catch (HttpClientErrorException e) { if (e.getStatusCode().value() == 400) { /* GET rule, merge fields, retry PUT */ } else { throw e; } }","preventionTips":["GET-then-PUT: fetch the whole rule, modify one field, PUT it all back","Treat alarm rule updates as full-object updates, not patches","Validate required fields before sending"],"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"}