{"record":{"id":"77ec9dbd3ffce045","repo":"SigNoz/signoz","slug":"multiple-values-s-are-not-allowed-for-operator","errorCode":null,"errorMessage":"multiple values %s are not allowed for operator `%s` for key `%s`","messagePattern":"multiple values (.+?) are not allowed for operator `(.+?)` for key `(.+?)`","errorType":"http","errorClass":"model.ApiError","httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/parser.go","lineNumber":879,"sourceCode":"\t\t\t\t\t\t\titem.Value = queryRangeParams.Variables[variableName]\n\t\t\t\t\t\t}\n\t\t\t\t\tcase []interface{}:\n\t\t\t\t\t\tif len(x) > 0 {\n\t\t\t\t\t\t\tswitch x[0].(type) {\n\t\t\t\t\t\t\tcase string:\n\t\t\t\t\t\t\t\tvariableName := strings.Trim(x[0].(string), \"{[.$]}\")\n\t\t\t\t\t\t\t\tif _, ok := queryRangeParams.Variables[variableName]; ok {\n\t\t\t\t\t\t\t\t\titem.Value = queryRangeParams.Variables[variableName]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif v3.FilterOperator(strings.ToLower((string(item.Operator)))) != v3.FilterOperatorIn && v3.FilterOperator(strings.ToLower((string(item.Operator)))) != v3.FilterOperatorNotIn {\n\t\t\t\t\t// the value type should not be multiple values\n\t\t\t\t\tif _, ok := item.Value.([]interface{}); ok {\n\t\t\t\t\t\treturn nil, &model.ApiError{Typ: model.ErrorBadData, Err: fmt.Errorf(\"multiple values %s are not allowed for operator `%s` for key `%s`\", item.Value, item.Operator, item.Key.Key)}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tqueryRangeParams.Variables = formattedVars\n\n\t// prometheus instant query needs same timestamp\n\tif queryRangeParams.CompositeQuery.PanelType == v3.PanelTypeValue &&\n\t\tqueryRangeParams.CompositeQuery.QueryType == v3.QueryTypePromQL {\n\t\tqueryRangeParams.Start = queryRangeParams.End\n\t}\n\n\t// replace go template variables in clickhouse query\n\tif queryRangeParams.CompositeQuery.QueryType == v3.QueryTypeClickHouseSQL {\n\t\tfor _, chQuery := range queryRangeParams.CompositeQuery.ClickHouseQueries {\n\t\t\tif chQuery.Disabled {\n\t\t\t\tcontinue","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/parser.go#L861-L897","documentation":"During sanitization of filter items in ParseQueryRangeParams, if the operator is not 'in' or 'nin', the value must be a scalar. An array value with a scalar operator (e.g. '=', '>', 'contains') triggers this error.","triggerScenarios":"Sending {\"key\":\"service_name\",\"operator\":\"=\",\"value\":[\"frontend\",\"backend\"]} — must use operator 'in' for multi-value filters.","commonSituations":"UI or client sending a multi-select value while keeping a scalar operator; migrating filter payloads where operators weren't updated.","solutions":["Use the 'in' (or 'nin') operator when supplying an array of values","Or keep the scalar operator and send a single value","Normalize filter payloads client-side before submission"],"exampleFix":"// before\n{\"operator\": \"=\", \"value\": [\"frontend\", \"backend\"]}\n// after\n{\"operator\": \"in\", \"value\": [\"frontend\", \"backend\"]}","handlingStrategy":"type-guard","validationCode":"isMulti := func(v interface{}) bool { _, ok := v.([]interface{}); return ok }\nop := strings.ToLower(string(item.Operator))\nif isMulti(item.Value) && op != \"in\" && op != \"nin\" { item.Operator = \"in\" }","typeGuard":"func isScalarFilterValue(v interface{}) bool { _, isArr := v.([]interface{}); return !isArr }","tryCatchPattern":null,"preventionTips":["In multi-select UIs, always emit the 'in' operator","Validate filter operator/value compatibility before POSTing"],"tags":["signoz","query-builder","filter","operator-validation"],"backgroundTag":"filter-operator-mismatch","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}