{"record":{"id":"0ae1a166d2529e89","repo":"SigNoz/signoz","slug":"filters-are-invalid-w","errorCode":null,"errorMessage":"filters are invalid: %w","messagePattern":"filters are invalid: %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":1064,"sourceCode":"\t\t\t// \t}\n\n\t\t\t// \tif err := b.SpaceAggregation.Validate(); err != nil {\n\t\t\t// \t\treturn fmt.Errorf(\"space aggregation is invalid: %w\", err)\n\t\t\t// \t}\n\t\t\t// }\n\t\t} else {\n\t\t\tif err := b.AggregateOperator.Validate(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"aggregate operator is invalid: %w\", err)\n\t\t\t}\n\t\t}\n\t\tif b.AggregateAttribute == (AttributeKey{}) && b.AggregateOperator.RequireAttribute(b.DataSource) {\n\t\t\treturn fmt.Errorf(\"aggregate attribute is required\")\n\t\t}\n\t}\n\n\tif b.Filters != nil {\n\t\tif err := b.Filters.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"filters are invalid: %w\", err)\n\t\t}\n\t}\n\tif b.GroupBy != nil {\n\t\t// if len(b.GroupBy) > 0 && panelType == PanelTypeList {\n\t\t// \treturn fmt.Errorf(\"group by is not supported for list panel type\")\n\t\t// }\n\n\t\tif panelType == PanelTypeValue && len(b.GroupBy) > 0 {\n\t\t\tif err := b.SecondaryAggregation.Validate(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"series aggregation is required for value type panel with group by: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\tfor _, groupBy := range b.GroupBy {\n\t\t\tif err := groupBy.Validate(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"group by is invalid %w\", err)\n\t\t\t}\n\t\t}","sourceCodeStart":1046,"sourceCodeEnd":1082,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L1046-L1082","documentation":"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.","triggerScenarios":"Sending a filter with operator \"matches\" (unsupported), an empty key, or items array mixing AND/OR incorrectly.","commonSituations":"Hand-written filter JSON or a UI bug generating operators the server enum doesn't include.","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"],"exampleFix":"// before\n{\"filters\":{\"op\":\"AND\",\"items\":[{\"key\":\"service\",\"op\":\"matches\",\"value\":\"api\"}]}}\n// after\n{\"filters\":{\"op\":\"AND\",\"items\":[{\"key\":\"service\",\"op\":\"contains\",\"value\":\"api\"}]}}","handlingStrategy":"validation","validationCode":"if b.Filters != nil { if err := b.Filters.Validate(); err != nil { return err } }","typeGuard":"func hasValidFilters(f *v3.FilterSet) bool { return f == nil || f.Validate() == nil }","tryCatchPattern":null,"preventionTips":["Restrict filter operator dropdown to the server enum"],"tags":["go","filter-validation","builder-query"],"backgroundTag":"filter-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}