{"record":{"id":"5bf8fd608ce561c3","repo":"pinpoint-apm/pinpoint","slug":"unknown-value","errorCode":null,"errorMessage":"Unknown value : ","messagePattern":"Unknown value : ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/model/basic/metric/group/GroupingRule.java","lineNumber":51,"sourceCode":"        this.value = Objects.requireNonNull(value, \"value\");\n    }\n\n    public static GroupingRule getByCode(int code) {\n        for (GroupingRule groupingRule : GroupingRule.values()) {\n            if (groupingRule.code == code) {\n                return groupingRule;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown code : \" + code);\n    }\n\n    public static GroupingRule getByValue(String value) {\n        for (GroupingRule groupingRule : GroupingRule.values()) {\n            if (groupingRule.value.equalsIgnoreCase(value)) {\n                return groupingRule;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown value : \" + value);\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":54,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/model/basic/metric/group/GroupingRule.java#L33-L54","documentation":"GroupingRule.getByValue throws IllegalArgumentException when the given string does not case-insensitively match the value of any GroupingRule enum constant. The enum maps request-supplied grouping values to internal grouping strategies, so only known values are accepted.","triggerScenarios":"Calling GroupingRule.getByValue with a value not in the enum's values() — e.g. a typo, a request query parameter carrying an unsupported grouping value, or a value from a different Pinpoint version.","commonSituations":"Frontend sending a grouping value not yet supported by the backend; API consumers copying values from docs of another version; manual edits to saved dashboard definitions referencing removed grouping rules.","solutions":["Use one of GroupingRule.values() values (inspect the enum for the exact accepted strings, comparison is case-insensitive).","Validate/normalize the incoming value against the enum before calling getByValue.","Catch IllegalArgumentException and fall back to a default GroupingRule.","If a new grouping is genuinely needed, add a new enum constant with the corresponding value."],"exampleFix":"// before\nGroupingRule rule = GroupingRule.getByValue(request.getParameter(\"grouping\"));\n\n// after\nString v = request.getParameter(\"grouping\");\nGroupingRule rule;\ntry {\n    rule = GroupingRule.getByValue(v);\n} catch (IllegalArgumentException e) {\n    rule = GroupingRule.DEFAULT;\n}","handlingStrategy":"try-catch","validationCode":"boolean valid = Arrays.stream(GroupingRule.values())\n    .anyMatch(r -> r.value.equalsIgnoreCase(candidate));","typeGuard":null,"tryCatchPattern":"try {\n    rule = GroupingRule.getByValue(value);\n} catch (IllegalArgumentException e) {\n    rule = GroupingRule.DEFAULT;\n}","preventionTips":["Derive allowed grouping values in the frontend from the same enum source.","Document valid values in the API and validate at the controller layer.","Prefer an Optional-returning lookup when adding new enum APIs."],"tags":["enum","argument-validation","metrics-web"],"backgroundTag":"invalid-enum-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}