SigNoz/signoz · error

CodeInvalidInput

CodeInvalidInput

Error message

existingQuery is not supported

What it means

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.

Source

Thrown at pkg/modules/aiobservability/implaiobservability/handler.go:72

			render.Error(rw, err)
			return
		}
	}

	render.Success(rw, http.StatusOK, &telemetrytypes.GettableFieldKeys{
		Keys:     aitelemetryschema.FieldKeys(keys, fieldKeySelector),
		Complete: complete,
	})
}

func (handler *handler) GetFieldsValues(rw http.ResponseWriter, req *http.Request) {
	ctx, cancel := context.WithTimeout(req.Context(), 10*time.Second)
	defer cancel()

	// binding ignores query params the struct does not declare, so an unsupported
	// existingQuery would silently return values it did not narrow
	if req.URL.Query().Has("existingQuery") {
		render.Error(rw, errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "existingQuery is not supported"))
		return
	}

	var params aiobservabilitytypes.PostableFieldValueParams
	if err := binding.Query.BindQuery(req.URL.Query(), &params); err != nil {
		render.Error(rw, err)
		return
	}

	claims, err := authtypes.ClaimsFromContext(ctx)
	if err != nil {
		render.Error(rw, err)
		return
	}

	fieldValueSelector := aiobservabilitytypes.NewFieldValueSelectorFromPostableFieldValueParams(params)

	values := &telemetrytypes.TelemetryFieldValues{}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Remove the existingQuery parameter from the request URL before calling the endpoint.
  2. If you need to narrow field values by a query, use the parameter the current PostableFieldValueParams declares (check the binding struct) instead of existingQuery.
  3. Clear saved explore state / bookmarks that embed the old parameter and re-generate the URL from the current UI.

Example fix

// before
GET /api/aiobservability/fields/values?fieldName=model&existingQuery={...}

// after
GET /api/aiobservability/fields/values?fieldName=model
Defensive patterns

Strategy: validation

Validate before calling

func stripUnsupportedParams(u *url.URL) error {
    if u.Query().Has("existingQuery") {
        return fmt.Errorf("existingQuery is not supported; remove it from %s", u.Path)
    }
    return nil
}

if err := stripUnsupportedParams(req.URL); err != nil {
    return err
}
resp, err := http.DefaultClient.Do(req)

Try / catch

if resp.StatusCode == http.StatusBadRequest {
    var body struct{ Message string `json:"message"` }
    _ = json.NewDecoder(resp.Body).Decode(&body)
    if strings.Contains(body.Message, "existingQuery") {
        // rebuild URL without the param and retry once
    }
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


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