{"record":{"id":"bb1e357467d59b77","repo":"pinpoint-apm/pinpoint","slug":"service-type-name-must-not-be-empty","errorCode":null,"errorMessage":"service type name must not be empty","messagePattern":"service type name must not be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedServiceType.java","lineNumber":83,"sourceCode":"    }\n\n    public void setProperty(ParsedServiceTypeProperty property) {\n        this.property = property;\n    }\n\n    public ParsedAnnotationKeyMatcher getMatcher() {\n        return matcher;\n    }\n\n    public void setMatcher(ParsedAnnotationKeyMatcher matcher) {\n        this.matcher = matcher;\n    }\n\n    ServiceTypeInfo toServiceTypeInfo() {\n        Objects.requireNonNull(code, \"code\");\n\n        if (StringUtils.isEmpty(name)) {\n            throw new IllegalArgumentException(\"service type name must not be empty\");\n        }\n        ServiceTypeBuilder builder;\n        if (StringUtils.isEmpty(desc)) {\n            builder = new ServiceTypeBuilder(code, name);\n        } else {\n            builder = new ServiceTypeBuilder(code, name, desc);\n        }\n        if (property != null) {\n            builder.terminal(property.isTerminal());\n            builder.queue(property.isQueue());\n            builder.recordStatistics(property.isRecordStatistics());\n            builder.includeDestinationId(property.isIncludeDestinationId());\n            builder.alias(property.isAlias());\n        }\n        ServiceType serviceType = builder.build();\n\n        if (matcher == null) {\n            return new DefaultServiceTypeInfo(serviceType);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedServiceType.java#L65-L101","documentation":"ParsedServiceType.toServiceTypeInfo() converts a YAML-declared service type into a ServiceTypeInfo. It first asserts that the numeric code is present, then that the string name is non-empty. A service type entry in a type-provider YAML with an empty or missing 'name' field cannot be registered, so an IllegalArgumentException is thrown.","triggerScenarios":"A type-provider YAML file contains a serviceTypes entry whose 'name' key is absent or set to \"\" (or whitespace), while 'code' is valid.","commonSituations":"Plugin authors hand-editing type-provider yml files; typo'd key names (e.g. 'serviceName' instead of 'name'); template placeholders like ${NAME} left unresolved or overridden to empty by build/env substitution.","solutions":["Open the offending type-provider YAML and give the serviceTypes entry a non-empty 'name' value","Check the key spelling is exactly 'name' (YAML is case-sensitive)","Verify no build/profile substitution (Maven/Gradle filtering, env vars) is blanking the value","Add CI validation that parses the YAML with this parser before shipping the plugin"],"exampleFix":"// before (type-provider.yml)\nserviceTypes:\n  - code: 1000\n    name: \"\"\n// after\nserviceTypes:\n  - code: 1000\n    name: \"MY_SERVICE\"","handlingStrategy":"validation","validationCode":"if (name == null || name.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"service type name must not be empty\");\n}\n// or in YAML tooling: assert entry.get(\"name\") is a non-blank string before shipping","typeGuard":"boolean hasNonEmptyName(Map<String,Object> entry) {\n    Object n = entry.get(\"name\");\n    return n instanceof String && !((String) n).trim().isEmpty();\n}","tryCatchPattern":null,"preventionTips":["Always set a non-empty 'name' for every serviceTypes entry","Lint type-provider YAMLs in CI before packaging","Avoid relying on unfiltered ${} placeholders that may resolve to empty"],"tags":["yaml","plugin","validation","config"],"backgroundTag":"empty-required-field","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"}