SigNoz/signoz · error
filters are invalid: %w
Error message
filters are invalid: %w
What it means
BuilderQuery.Validate calls Filters.Validate on the filter set; failure means an invalid filter operator, an empty key, or an malformed item in filters.items.
Source
Thrown at pkg/query-service/model/v3/v3.go:1064
// }
// if err := b.SpaceAggregation.Validate(); err != nil {
// return fmt.Errorf("space aggregation is invalid: %w", err)
// }
// }
} else {
if err := b.AggregateOperator.Validate(); err != nil {
return fmt.Errorf("aggregate operator is invalid: %w", err)
}
}
if b.AggregateAttribute == (AttributeKey{}) && b.AggregateOperator.RequireAttribute(b.DataSource) {
return fmt.Errorf("aggregate attribute is required")
}
}
if b.Filters != nil {
if err := b.Filters.Validate(); err != nil {
return fmt.Errorf("filters are invalid: %w", err)
}
}
if b.GroupBy != nil {
// if len(b.GroupBy) > 0 && panelType == PanelTypeList {
// return fmt.Errorf("group by is not supported for list panel type")
// }
if panelType == PanelTypeValue && len(b.GroupBy) > 0 {
if err := b.SecondaryAggregation.Validate(); err != nil {
return fmt.Errorf("series aggregation is required for value type panel with group by: %w", err)
}
}
for _, groupBy := range b.GroupBy {
if err := groupBy.Validate(); err != nil {
return fmt.Errorf("group by is invalid %w", err)
}
}View on GitHub (pinned to 5069bf80b0)
Solutions
- Check the wrapped error for which filter/op failed
- Use supported operators (equals, not_equals, in, not_in, like, not_like, >, <, >=, <=, contains, not_contains, starts_with, ends_with)
- Ensure each item has a non-empty key and a value matching its dataType
Example fix
// before
{"filters":{"op":"AND","items":[{"key":"service","op":"matches","value":"api"}]}}
// after
{"filters":{"op":"AND","items":[{"key":"service","op":"contains","value":"api"}]}} Defensive patterns
Strategy: validation
Validate before calling
if b.Filters != nil { if err := b.Filters.Validate(); err != nil { return err } } Type guard
func hasValidFilters(f *v3.FilterSet) bool { return f == nil || f.Validate() == nil } Prevention
- Restrict filter operator dropdown to the server enum
When it happens
Trigger: Sending a filter with operator "matches" (unsupported), an empty key, or items array mixing AND/OR incorrectly.
Common situations: Hand-written filter JSON or a UI bug generating operators the server enum doesn't include.
Related errors
- builder query %s is invalid: %w
- query name is required
- invalid data type, expected int, got %v
- CodeInvalidInput
- ErrCodeIncorrectPassword
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/0ae1a166d2529e89.
Report an issue: GitHub.