{"record":{"id":"c4dfbe0b8baadc7f","repo":"SigNoz/signoz","slug":"codeinvalidinput-c4dfbe","errorCode":"CodeInvalidInput","errorMessage":"existingQuery is not supported","messagePattern":"existingQuery is not supported","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/modules/aiobservability/implaiobservability/handler.go","lineNumber":72,"sourceCode":"\t\t\trender.Error(rw, err)\n\t\t\treturn\n\t\t}\n\t}\n\n\trender.Success(rw, http.StatusOK, &telemetrytypes.GettableFieldKeys{\n\t\tKeys:     aitelemetryschema.FieldKeys(keys, fieldKeySelector),\n\t\tComplete: complete,\n\t})\n}\n\nfunc (handler *handler) GetFieldsValues(rw http.ResponseWriter, req *http.Request) {\n\tctx, cancel := context.WithTimeout(req.Context(), 10*time.Second)\n\tdefer cancel()\n\n\t// binding ignores query params the struct does not declare, so an unsupported\n\t// existingQuery would silently return values it did not narrow\n\tif req.URL.Query().Has(\"existingQuery\") {\n\t\trender.Error(rw, errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"existingQuery is not supported\"))\n\t\treturn\n\t}\n\n\tvar params aiobservabilitytypes.PostableFieldValueParams\n\tif err := binding.Query.BindQuery(req.URL.Query(), &params); err != nil {\n\t\trender.Error(rw, err)\n\t\treturn\n\t}\n\n\tclaims, err := authtypes.ClaimsFromContext(ctx)\n\tif err != nil {\n\t\trender.Error(rw, err)\n\t\treturn\n\t}\n\n\tfieldValueSelector := aiobservabilitytypes.NewFieldValueSelectorFromPostableFieldValueParams(params)\n\n\tvalues := &telemetrytypes.TelemetryFieldValues{}","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/modules/aiobservability/implaiobservability/handler.go#L54-L90","documentation":"Returned by the AI observability GetFieldsValues HTTP handler when the request includes an existingQuery query parameter. The parameterized params struct (PostableFieldValueParams) does not declare existingQuery, so binding would silently ignore it and return values that were not narrowed by it. The handler explicitly rejects the request to avoid misleading results.","triggerScenarios":"Calling GET on the field-values endpoint of the AI observability API with ?existingQuery=... in the URL (e.g. copied from a saved explore URL or an older/newer UI that sends that param).","commonSituations":"Upgrading or downgrading the last.ai/grafana observability plugin where URL state from one version is replayed against another; bookmarks or shared links carrying stale query params; automated clients built against a different API version.","solutions":["Remove the existingQuery parameter from the request URL before calling the endpoint.","If you need to narrow field values by a query, use the parameter the current PostableFieldValueParams declares (check the binding struct) instead of existingQuery.","Clear saved explore state / bookmarks that embed the old parameter and re-generate the URL from the current UI."],"exampleFix":"// before\nGET /api/aiobservability/fields/values?fieldName=model&existingQuery={...}\n\n// after\nGET /api/aiobservability/fields/values?fieldName=model","handlingStrategy":"validation","validationCode":"func stripUnsupportedParams(u *url.URL) error {\n    if u.Query().Has(\"existingQuery\") {\n        return fmt.Errorf(\"existingQuery is not supported; remove it from %s\", u.Path)\n    }\n    return nil\n}\n\nif err := stripUnsupportedParams(req.URL); err != nil {\n    return err\n}\nresp, err := http.DefaultClient.Do(req)","typeGuard":null,"tryCatchPattern":"if resp.StatusCode == http.StatusBadRequest {\n    var body struct{ Message string `json:\"message\"` }\n    _ = json.NewDecoder(resp.Body).Decode(&body)\n    if strings.Contains(body.Message, \"existingQuery\") {\n        // rebuild URL without the param and retry once\n    }\n}","preventionTips":["Build request URLs from a typed params struct instead of copying raw URLs.","Regenerate saved/share links after upgrading the plugin so stale params are dropped."],"tags":["aiobservability","http","query-params","invalid-input"],"backgroundTag":"unsupported-query-parameter","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}