apache/skywalking · critical · IllegalArgumentException

service-name can't be empty

Error message

service-name can't be empty

What it means

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.

Source

Thrown at oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointGroupingRuleReader.java:61

    public EndpointGroupingRuleReader(Reader io) {
        Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
        yamlData = (Map) yaml.load(io);
    }

    /**
     * @return the loaded rules.
     */
    QuickUriGroupingRule read() {
        QuickUriGroupingRule quickUriGroupingRule = new QuickUriGroupingRule();

        if (Objects.nonNull(yamlData)) {
            List rulesData = (List) yamlData.get("grouping");
            if (rulesData != null) {
                rulesData.forEach(ruleObj -> {
                    final Map rule = (Map) ruleObj;
                    final String serviceName = (String) rule.get("service-name");
                    if (StringUtil.isEmpty(serviceName)) {
                        throw new IllegalArgumentException("service-name can't be empty");
                    }
                    final List endpointRules = (List) rule.get("rules");
                    if (endpointRules != null) {
                        endpointRules.forEach(endpointRuleObj -> {
                            final String pattern = (String) endpointRuleObj;
                            if (StringUtil.isEmpty(pattern)) {
                                return;
                            }
                            quickUriGroupingRule.addRule(serviceName, pattern);
                        });
                    }
                });
            }
        }

        return quickUriGroupingRule;
    }
}

View on GitHub (pinned to 102af09b4a)

Solutions

  1. 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.
  2. Verify YAML structure: each list item under 'grouping:' must be a mapping with 'service-name' and a 'rules' list, indented consistently.
  3. Restart OAP.

Example fix

# before
grouping:
  - rules:
      - /api/v1/users/.*

# after
grouping:
  - service-name: my-service
    rules:
      - /api/v1/users/.*
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight the grouping YAML
for (Object ruleObj : (List) yaml.getOrDefault("grouping", List.of())) {
    String sn = (String) ((Map) ruleObj).get("service-name");
    if (sn == null || sn.trim().isEmpty()) {
        throw new ConfigException("grouping rule missing service-name");
    }
}

Try / catch

Not applicable — fix the YAML; catching startup failure hides a broken config.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14). Data as JSON: /api/errors/0c4c859bc2f13b4f. Report an issue: GitHub.