SigNoz/signoz · error
type param cannot be empty from the query
Error message
type param cannot be empty from the query
What it means
Thrown by parseGetTTL when reading current TTL settings: the request must include a non-empty 'type' query parameter identifying which signal's TTL to fetch.
Source
Thrown at pkg/query-service/app/parser.go:472
if toColdParsed.Seconds() != 0 && toColdParsed.Seconds() >= durationParsed.Seconds() {
return nil, fmt.Errorf("delete TTL should be greater than cold storage move TTL")
}
}
return &retentiontypes.TTLParams{
Type: typeTTL,
DelDuration: int64(durationParsed.Seconds()),
ColdStorageVolume: coldStorage,
ToColdStorageDuration: int64(toColdParsed.Seconds()),
}, nil
}
func parseGetTTL(r *http.Request) (*retentiontypes.GetTTLParams, error) {
typeTTL := r.URL.Query().Get("type")
if len(typeTTL) == 0 {
return nil, fmt.Errorf("type param cannot be empty from the query")
} else {
// Validate the type parameter
if typeTTL != retentiontypes.TraceTTL && typeTTL != retentiontypes.MetricsTTL && typeTTL != retentiontypes.LogsTTL {
return nil, fmt.Errorf("type param should be metrics|traces|logs, got %v", typeTTL)
}
}
return &retentiontypes.GetTTLParams{Type: typeTTL}, nil
}
func parseAggregateAttributeRequest(r *http.Request) (*v3.AggregateAttributeRequest, error) {
var req v3.AggregateAttributeRequest
aggregateOperator := v3.AggregateOperator(r.URL.Query().Get("aggregateOperator"))
dataSource := v3.DataSource(r.URL.Query().Get("dataSource"))
aggregateAttribute := r.URL.Query().Get("searchText")
limit, err := strconv.Atoi(r.URL.Query().Get("limit"))View on GitHub (pinned to 5069bf80b0)
Solutions
- Add ?type=traces|metrics|logs to the GET request
- Issue one request per signal type if you need all three
- Check for typos in the param name
Example fix
// before curl 'http://localhost:8080/api/v1/ttl' // after curl 'http://localhost:8080/api/v1/ttl?type=traces'
Defensive patterns
Strategy: validation
Validate before calling
if r.URL.Query().Get("type") == "" { return errors.New("type query param required for getTTL") } Prevention
- Fetch TTL per signal in a loop over [traces, metrics, logs]
- Build query strings with a helper that asserts required params
When it happens
Trigger: Calling GET /api/v1/ttl (or the retention get endpoint) with no ?type= parameter.
Common situations: Assuming the get endpoint returns TTLs for all signals at once; frontend bug dropping the type param; manual curl without params.
Related errors
- type and duration param cannot be empty from the query
- SetTTLV2 only supported
- error while getting ttl. Err=%v
- type param should be metrics|traces|logs, got %v
- not a valid TTL duration %v
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/1adcdbc1df30da91.
Report an issue: GitHub.