{"record":{"id":"e7c2acee9b095ab0","repo":"SigNoz/signoz","slug":"errcodeinvalidstate","errorCode":"ErrCodeInvalidState","errorMessage":"saml: invalid state","messagePattern":"saml: invalid state","errorType":"error_code","errorClass":"errors.Error","httpStatus":400,"severity":"error","filePath":"ee/authn/callbackauthn/samlcallbackauthn/authn.go","lineNumber":59,"sourceCode":"\nfunc (a *AuthN) LoginURL(ctx context.Context, siteURL *url.URL, authDomain *authtypes.AuthDomain) (string, error) {\n\tsp, err := a.serviceProvider(siteURL, authDomain)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\turl, err := sp.BuildAuthURL(authtypes.NewState(siteURL, authDomain.StorableAuthDomain().ID).URL.String())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn url, nil\n}\n\nfunc (a *AuthN) HandleCallback(ctx context.Context, formValues url.Values) (*authtypes.CallbackIdentity, error) {\n\tstate, err := authtypes.NewStateFromString(formValues.Get(\"RelayState\"))\n\tif err != nil {\n\t\treturn nil, errors.New(errors.TypeInvalidInput, authtypes.ErrCodeInvalidState, \"saml: invalid state\").WithAdditional(err.Error())\n\t}\n\n\tauthDomain, err := a.store.GetAuthDomainFromID(ctx, state.DomainID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = a.licensing.GetActive(ctx, authDomain.StorableAuthDomain().OrgID)\n\tif err != nil {\n\t\treturn nil, errors.New(errors.TypeLicenseUnavailable, errors.CodeLicenseUnavailable, \"a valid license is not available\").WithAdditional(\"this feature requires a valid license\").WithAdditional(err.Error())\n\t}\n\n\tsamlConfig, err := authDomain.Config().SamlConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsp, err := a.serviceProvider(state.URL, authDomain)","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/authn/callbackauthn/samlcallbackauthn/authn.go#L41-L77","documentation":"Default branch of the filter-operator switch in PrepareTimeseriesFilterQuery (SigNoz metrics v4 helpers, sub_query.go). Each tag filter item carries a FilterOperator (=, !=, in, like, ilike, exists, etc.); when an item's operator has no case here the builder cannot emit a ClickHouse WHERE condition and fails.","triggerScenarios":"A v4 metrics query whose filters array contains an item with an operator outside the handled set — e.g. '>' with string operands, an operator string typo, or an operator supported only in the v3 builder. Reached via prepareTimeAggregationSubQuery / prepareQueryOptimized.","commonSituations":"Migrating dashboards from v3 to v4 query APIs where the operator vocabularies differ; UI sending an operator the backend v4 path hasn't implemented yet; programmatic filter construction reusing enums from another package.","solutions":["Log the failing filter item and replace its operator with one supported by the v4 sub-query builder (=, !=, in, nin, contains/matches-style like operators, exists, nexists, ilike variants)","Keep SigNoz UI and query-service versions in sync so v4 filter operators line up","Add a pre-validation pass over qp.Filters rejecting unknown operators before building"],"exampleFix":"// before\nfilters: []v3.FilterItem{{Key: tagKey, Operator: \">\", Value: \"abc\"}}\n\n// after\nfilters: []v3.FilterItem{{Key: tagKey, Operator: v3.FilterOperatorEqual, Value: \"abc\"}}","handlingStrategy":"validation","validationCode":"var v4FilterOps = map[v3.FilterOperator]bool{v3.FilterOperatorEqual: true, v3.FilterOperatorNotEqual: true, v3.FilterOperatorIn: true, v3.FilterOperatorNotIn: true, v3.FilterOperatorLike: true, v3.FilterOperatorILike: true, v3.FilterOperatorNotILike: true, v3.FilterOperatorExists: true, v3.FilterOperatorNotExists: true}\nfor _, f := range qp.Filters {\n\tif !v4FilterOps[f.Operator] {\n\t\treturn fmt.Errorf(\"filter operator %q not supported\", f.Operator)\n\t}\n}","typeGuard":"null","tryCatchPattern":"if _, err := helpers.PrepareTimeseriesFilterQuery(...); err != nil && strings.Contains(err.Error(), \"unsupported filter operator\") {\n\t// strip or rewrite the offending filter and rebuild\n}","preventionTips":["Mirror the builder's operator switch as a shared allowlist","Test dashboards against the v4 path before release","Reject unknown operators at API ingress with field-level errors"],"tags":["signoz","metrics","v4","query-builder","filter-operator","clickhouse"],"backgroundTag":"unsupported-filter-operator","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}