{"record":{"id":"05c7b858cc7ad800","repo":"thanos-io/thanos","slug":"no-match-parameter-provided","errorCode":null,"errorMessage":"no match[] parameter provided","messagePattern":"no match\\[\\] parameter provided","errorType":"http","errorClass":"ApiError","httpStatus":400,"severity":"error","filePath":"pkg/api/query/v1.go","lineNumber":1176,"sourceCode":"\tif vals == nil {\n\t\tvals = make([]string, 0)\n\t}\n\n\tif limit > 0 && len(vals) > limit {\n\t\tvals = vals[:limit]\n\t\twarnings = warnings.Add(errors.New(\"results truncated due to limit\"))\n\t}\n\n\treturn vals, warnings.AsErrors(), nil, func() {}\n}\n\nfunc (qapi *QueryAPI) series(r *http.Request) (any, []error, *api.ApiError, func()) {\n\tif err := r.ParseForm(); err != nil {\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorInternal, Err: errors.Wrap(err, \"parse form\")}, func() {}\n\t}\n\n\tif len(r.Form[MatcherParam]) == 0 {\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.New(\"no match[] parameter provided\")}, func() {}\n\t}\n\n\tstart, end, err := parseMetadataTimeRange(r, qapi.defaultMetadataTimeRange)\n\tif err != nil {\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}\n\t}\n\n\tmatcherSets, ctx, err := tenancy.RewriteLabelMatchers(r.Context(), r, qapi.tenantHeader, qapi.defaultTenant, qapi.tenantCertField, qapi.enforceTenancy, qapi.tenantLabel, r.Form[MatcherParam])\n\tif err != nil {\n\t\tapiErr := &api.ApiError{Typ: api.ErrorBadData, Err: err}\n\t\treturn nil, nil, apiErr, func() {}\n\t}\n\n\tenableDedup, apiErr := qapi.parseEnableDedupParam(r)\n\tif apiErr != nil {\n\t\treturn nil, nil, apiErr, func() {}\n\t}\n","sourceCodeStart":1158,"sourceCodeEnd":1194,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/api/query/v1.go#L1158-L1194","documentation":"The series endpoint requires at least one match[] parameter to select series; if r.Form[MatcherParam] is empty it returns ErrorBadData (HTTP 400) \"no match[] parameter provided\". Without matchers the querier cannot determine which series to return.","triggerScenarios":"GET/POST /api/v1/series without any match[] form value, or with match[] present but an empty string so it doesn't register in r.Form.","commonSituations":"Clients forgetting the mandatory parameter; URL encoding issues dropping the value; dashboards with unset template variables producing empty match[].","solutions":["Add at least one match[] parameter, e.g. ?match[]=up","If a dashboard variable may be empty, substitute a catch-all matcher like {__name__!=\"\"}","Verify URL encoding so match[] actually reaches the server"],"exampleFix":"// before\nGET /api/v1/series\n// after\nGET /api/v1/series?match[]=up","handlingStrategy":"validation","validationCode":"if len(matchers) == 0 {\n    matchers = []string{`{__name__!=\"\"}`} // or return an error to the user first\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat match[] as mandatory for /api/v1/series and validate before sending","Guard dashboard template variables with fallback matchers","Log the fully-built URL in clients to catch silently dropped parameters"],"tags":["http-api","series","missing-parameter"],"backgroundTag":"missing-required-argument","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"}