SigNoz/signoz · error · model.ApiError

multiple values %s are not allowed for operator `%s` for key

Error message

multiple values %s are not allowed for operator `%s` for key `%s`

What it means

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.

Source

Thrown at pkg/query-service/app/parser.go:879

							item.Value = queryRangeParams.Variables[variableName]
						}
					case []interface{}:
						if len(x) > 0 {
							switch x[0].(type) {
							case string:
								variableName := strings.Trim(x[0].(string), "{[.$]}")
								if _, ok := queryRangeParams.Variables[variableName]; ok {
									item.Value = queryRangeParams.Variables[variableName]
								}
							}
						}
					}
				}

				if v3.FilterOperator(strings.ToLower((string(item.Operator)))) != v3.FilterOperatorIn && v3.FilterOperator(strings.ToLower((string(item.Operator)))) != v3.FilterOperatorNotIn {
					// the value type should not be multiple values
					if _, ok := item.Value.([]interface{}); ok {
						return 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)}
					}
				}
			}
		}
	}
	queryRangeParams.Variables = formattedVars

	// prometheus instant query needs same timestamp
	if queryRangeParams.CompositeQuery.PanelType == v3.PanelTypeValue &&
		queryRangeParams.CompositeQuery.QueryType == v3.QueryTypePromQL {
		queryRangeParams.Start = queryRangeParams.End
	}

	// replace go template variables in clickhouse query
	if queryRangeParams.CompositeQuery.QueryType == v3.QueryTypeClickHouseSQL {
		for _, chQuery := range queryRangeParams.CompositeQuery.ClickHouseQueries {
			if chQuery.Disabled {
				continue

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Use the 'in' (or 'nin') operator when supplying an array of values
  2. Or keep the scalar operator and send a single value
  3. Normalize filter payloads client-side before submission

Example fix

// before
{"operator": "=", "value": ["frontend", "backend"]}
// after
{"operator": "in", "value": ["frontend", "backend"]}
Defensive patterns

Strategy: type-guard

Validate before calling

isMulti := func(v interface{}) bool { _, ok := v.([]interface{}); return ok }
op := strings.ToLower(string(item.Operator))
if isMulti(item.Value) && op != "in" && op != "nin" { item.Operator = "in" }

Type guard

func isScalarFilterValue(v interface{}) bool { _, isArr := v.([]interface{}); return !isArr }

Prevention

When it happens

Trigger: Sending {"key":"service_name","operator":"=","value":["frontend","backend"]} — must use operator 'in' for multi-value filters.

Common situations: UI or client sending a multi-select value while keeping a scalar operator; migrating filter payloads where operators weren't updated.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/77ec9dbd3ffce045. Report an issue: GitHub.