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
- 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.
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
- 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).
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
- hierarchy-definition.yml {layer} is not a valid layer name.
- hierarchy-definition.yml layer-levels: {layer} is not defin
- hierarchy-definition.yml layer-levels: {lowerLayer} is not
- hierarchy-definition.yml hierarchy: {layer} layer-level shou
- OpenAPI definition file: {file.getAbsolutePath()} found in r
AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14).
Data as JSON: /api/errors/0c4c859bc2f13b4f.
Report an issue: GitHub.