{"record":{"id":"699b527995b5523e","repo":"pinpoint-apm/pinpoint","slug":"matcher-type-must-not-be-empty","errorCode":null,"errorMessage":"matcher type must not be empty","messagePattern":"matcher type 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/ParsedAnnotationKeyMatcher.java","lineNumber":51,"sourceCode":"    public String getType() {\n        return type;\n    }\n\n    public void setType(String type) {\n        this.type = type;\n    }\n\n    public Integer getCode() {\n        return code;\n    }\n\n    public void setCode(Integer code) {\n        this.code = code;\n    }\n\n    AnnotationKeyMatcher toAnnotationKeyMatcher() {\n        if (StringUtils.isEmpty(type)) {\n            throw new IllegalArgumentException(\"matcher type must not be empty\");\n        }\n        if (type.equalsIgnoreCase(\"exact\")) {\n            Objects.requireNonNull(code, \"code must not be null for matcher type 'exact'\");\n            return AnnotationKeyMatchers.exact(code);\n        } else if (type.equalsIgnoreCase(\"args\")) {\n            return AnnotationKeyMatchers.ARGS_MATCHER;\n        } else if (type.equalsIgnoreCase(\"none\")) {\n            return AnnotationKeyMatchers.NOTHING_MATCHER;\n        }\n        throw new IllegalStateException(\"Unknown matcher type : \" + type);\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":64,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedAnnotationKeyMatcher.java#L33-L64","documentation":"Thrown by ParsedAnnotationKeyMatcher.toAnnotationKeyMatcher when a matcher entry in a YAML type-provider definition lacks a 'type' field (empty/null). The type selects which AnnotationKeyMatcher to build (exact/args/none), so it is mandatory.","triggerScenarios":"Loading a plugin yaml where annotationKeyMatcher is declared without type, e.g. only a code is given, or type: '' ","commonSituations":"Partially written yaml definitions; misunderstanding that matcher entries require a type; copy-pasting only the code field from another matcher.","solutions":["Set type to one of: exact, args, or none in the matcher entry","Remove the incomplete matcher entry if the default matching behavior is acceptable","Cross-check the yaml against a working plugin's type-provider definition","Reload the plugin after fixing and verify via agent startup logs"],"exampleFix":"// before (plugin yaml)\nannotationKeyMatcher:\n  - code: 900\n    # type missing\n// after\nannotationKeyMatcher:\n  - code: 900\n    type: exact","handlingStrategy":"validation","validationCode":"matchers.forEach(m -> {\n  if (m.getType() == null || m.getType().isEmpty()) throw new IllegalStateException(\"matcher missing type\");\n  if (!Set.of(\"exact\",\"args\",\"none\").contains(m.getType().toLowerCase())) throw new IllegalStateException(\"bad matcher type: \" + m.getType());\n});","typeGuard":null,"tryCatchPattern":"try { matcher = parsed.toAnnotationKeyMatcher(); } catch (IllegalArgumentException e) { log.error(\"bad annotationKeyMatcher in plugin yaml: {}\", e.getMessage()); throw e; }","preventionTips":["Always specify type (exact/args/none) on matcher entries","Validate plugin yamls in CI before packaging","Reuse a known-good yaml as a template"],"tags":["java","yaml","plugin","validation"],"backgroundTag":"missing-required-config-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"}