SigNoz/signoz · error
invalid_request_query
invalid_request_query
Error message
invalid query
What it means
BindQuery fails when request query parameters cannot be mapped onto the target struct using the 'query' tag. The underlying gin MapFormWithTag error is attached as additional detail, covering bad type conversions and malformed syntax.
Source
Thrown at pkg/http/binding/query.go:19
package binding
import (
"github.com/SigNoz/signoz/pkg/errors"
ginbinding "github.com/gin-gonic/gin/binding"
)
const (
ErrMessageInvalidQuery string = "request query contains invalid fields, please verify the format and try again."
)
var _ BindingQuery = (*queryBinding)(nil)
type queryBinding struct{}
func (b *queryBinding) BindQuery(query map[string][]string, obj any) error {
err := ginbinding.MapFormWithTag(obj, query, "query")
if err != nil {
return errors.New(errors.TypeInvalidInput, ErrCodeInvalidRequestQuery, ErrMessageInvalidQuery).WithAdditional(err.Error())
}
return nil
}
View on GitHub (pinned to 5069bf80b0)
Solutions
- Check the endpoint's expected query params and their types; fix the offending value
- Inspect the error's additional detail for the exact failing parameter
- URL-encode values properly and remove unknown/renamed params
Example fix
// before GET /api/v2/traces?limit=abc // after GET /api/v2/traces?limit=100
Defensive patterns
Strategy: validation
Validate before calling
if _, err := strconv.Atoi(r.URL.Query().Get("limit")); err != nil { return fmt.Errorf("limit must be an integer") } Type guard
func validQuery(q url.Values) bool {
if l := q.Get("limit"); l != "" { if _, err := strconv.Atoi(l); err != nil { return false } }
return true
} Try / catch
err := binding.BindQuery(r.URL.Query(), &target)
if err != nil { /* read errors.Asc detail, report offending param */ } Prevention
- Type-check query params client-side
- Keep param names in sync with the struct's `query` tags
When it happens
Trigger: Calling endpoints like ListV2, GetFieldsKeys, GetFieldsValues, or public widget APIs with query params that don't match expected types (e.g. limit=abc, bad timestamps, invalid enum values).
Common situations: Hand-written URLs with typos, outdated param names after API version changes, clients sending boolean/number params in wrong formats.
Related errors
- ErrCodeRoleInvalidInput
- CodeInvalidInput
- invalid_input
- integration_id is required
- CodeLicenseUnavailable
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/d8d83bdcc9c678c0.
Report an issue: GitHub.