{"record":{"id":"f7a6d330f25c975d","repo":"thanos-io/thanos","slug":"unrecognized-label-matcher-type-d","errorCode":null,"errorMessage":"unrecognized label matcher type %d","messagePattern":"unrecognized label matcher type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/storepb/custom.go","lineNumber":423,"sourceCode":"\t}\n\treturn res, nil\n}\n\n// MatcherToPromMatcher converts a Thanos label matcher to Prometheus label matcher.\nfunc MatcherToPromMatcher(m LabelMatcher) (*labels.Matcher, error) {\n\tvar t labels.MatchType\n\n\tswitch m.Type {\n\tcase LabelMatcher_EQ:\n\t\tt = labels.MatchEqual\n\tcase LabelMatcher_NEQ:\n\t\tt = labels.MatchNotEqual\n\tcase LabelMatcher_RE:\n\t\tt = labels.MatchRegexp\n\tcase LabelMatcher_NRE:\n\t\tt = labels.MatchNotRegexp\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unrecognized label matcher type %d\", m.Type)\n\t}\n\treturn labels.NewMatcher(t, m.Name, m.Value)\n}\n\n// MatchersToString converts label matchers to string format.\n// String should be parsable as a valid PromQL query metric selector.\nfunc MatchersToString(ms ...LabelMatcher) string {\n\tvar res string\n\tfor i, m := range ms {\n\t\tres += m.PromString()\n\t\tif i < len(ms)-1 {\n\t\t\tres += \", \"\n\t\t}\n\t}\n\treturn \"{\" + res + \"}\"\n}\n\n// PromMatchersToString converts prometheus label matchers to string format.","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/storepb/custom.go#L405-L441","documentation":"The inverse conversion guard: a Thanos LabelMatcher proto carrying a Type outside EQ/NEQ/RE/NRE cannot be mapped to a Prometheus labels.MatchType. Since the proto enum only defines those four values, this fires on out-of-range enum numbers (corrupted or unknown-version wire data), not on normal query input.","triggerScenarios":"Thrown at pkg/store/storepb/custom.go:423 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for version skew between the components exchanging storepb matchers","Reject/replace the malformed request data at the boundary","Upgrade both sides to compatible Thanos versions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}