{"record":{"id":"0c4c859bc2f13b4f","repo":"apache/skywalking","slug":"service-name-can-t-be-empty","errorCode":null,"errorMessage":"service-name can't be empty","messagePattern":"service-name can't be empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointGroupingRuleReader.java","lineNumber":61,"sourceCode":"    public EndpointGroupingRuleReader(Reader io) {\n        Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));\n        yamlData = (Map) yaml.load(io);\n    }\n\n    /**\n     * @return the loaded rules.\n     */\n    QuickUriGroupingRule read() {\n        QuickUriGroupingRule quickUriGroupingRule = new QuickUriGroupingRule();\n\n        if (Objects.nonNull(yamlData)) {\n            List rulesData = (List) yamlData.get(\"grouping\");\n            if (rulesData != null) {\n                rulesData.forEach(ruleObj -> {\n                    final Map rule = (Map) ruleObj;\n                    final String serviceName = (String) rule.get(\"service-name\");\n                    if (StringUtil.isEmpty(serviceName)) {\n                        throw new IllegalArgumentException(\"service-name can't be empty\");\n                    }\n                    final List endpointRules = (List) rule.get(\"rules\");\n                    if (endpointRules != null) {\n                        endpointRules.forEach(endpointRuleObj -> {\n                            final String pattern = (String) endpointRuleObj;\n                            if (StringUtil.isEmpty(pattern)) {\n                                return;\n                            }\n                            quickUriGroupingRule.addRule(serviceName, pattern);\n                        });\n                    }\n                });\n            }\n        }\n\n        return quickUriGroupingRule;\n    }\n}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointGroupingRuleReader.java#L43-L79","documentation":"EndpointGroupingRuleReader.read() parses the endpoint grouping YAML (configured via core.rule-ext-grouping or the endpoint grouping file). Each rule under the top-level 'grouping:' list must carry a non-empty 'service-name' key, because rules are registered per service name via quickUriGroupingRule.addRule(serviceName, pattern). An empty or absent service-name makes the rule unusable, so parsing throws IllegalArgumentException at startup.","triggerScenarios":"OAP startup loads an endpoint grouping YAML whose 'grouping:' list contains an entry without a 'service-name' key or with an empty/null value; StringUtil.isEmpty(serviceName) is true.","commonSituations":"Writing a grouping file modeled on openapi rules where service-name is optional; YAML indentation mistakes putting service-name outside the rule map; copying a template and deleting the service-name line; using a YAML value that parses as non-string.","solutions":["Open the endpoint grouping YAML referenced by application.yml (core.rule-ext-grouping) and add a non-empty 'service-name' to the rule named implicitly by the error position.","Verify YAML structure: each list item under 'grouping:' must be a mapping with 'service-name' and a 'rules' list, indented consistently.","Restart OAP."],"exampleFix":"# before\ngrouping:\n  - rules:\n      - /api/v1/users/.*\n\n# after\ngrouping:\n  - service-name: my-service\n    rules:\n      - /api/v1/users/.*","handlingStrategy":"validation","validationCode":"// Pre-flight the grouping YAML\nfor (Object ruleObj : (List) yaml.getOrDefault(\"grouping\", List.of())) {\n    String sn = (String) ((Map) ruleObj).get(\"service-name\");\n    if (sn == null || sn.trim().isEmpty()) {\n        throw new ConfigException(\"grouping rule missing service-name\");\n    }\n}","typeGuard":null,"tryCatchPattern":"Not applicable — fix the YAML; catching startup failure hides a broken config.","preventionTips":["Use a JSON-schema for the grouping file in editor/CI.","Template every new rule from a known-good example that includes service-name.","YAML-lint the file (many tools catch indentation that detaches service-name from its rule)."],"tags":["configuration","endpoint-grouping","yaml","startup","validation"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}