{"record":{"id":"1adcdbc1df30da91","repo":"SigNoz/signoz","slug":"type-param-cannot-be-empty-from-the-query","errorCode":null,"errorMessage":"type param cannot be empty from the query","messagePattern":"type param cannot be empty from the query","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/query-service/app/parser.go","lineNumber":472,"sourceCode":"\t\tif toColdParsed.Seconds() != 0 && toColdParsed.Seconds() >= durationParsed.Seconds() {\n\t\t\treturn nil, fmt.Errorf(\"delete TTL should be greater than cold storage move TTL\")\n\t\t}\n\t}\n\n\treturn &retentiontypes.TTLParams{\n\t\tType:                  typeTTL,\n\t\tDelDuration:           int64(durationParsed.Seconds()),\n\t\tColdStorageVolume:     coldStorage,\n\t\tToColdStorageDuration: int64(toColdParsed.Seconds()),\n\t}, nil\n}\n\nfunc parseGetTTL(r *http.Request) (*retentiontypes.GetTTLParams, error) {\n\n\ttypeTTL := r.URL.Query().Get(\"type\")\n\n\tif len(typeTTL) == 0 {\n\t\treturn nil, fmt.Errorf(\"type param cannot be empty from the query\")\n\t} else {\n\t\t// Validate the type parameter\n\t\tif typeTTL != retentiontypes.TraceTTL && typeTTL != retentiontypes.MetricsTTL && typeTTL != retentiontypes.LogsTTL {\n\t\t\treturn nil, fmt.Errorf(\"type param should be metrics|traces|logs, got %v\", typeTTL)\n\t\t}\n\t}\n\n\treturn &retentiontypes.GetTTLParams{Type: typeTTL}, nil\n}\n\nfunc parseAggregateAttributeRequest(r *http.Request) (*v3.AggregateAttributeRequest, error) {\n\tvar req v3.AggregateAttributeRequest\n\n\taggregateOperator := v3.AggregateOperator(r.URL.Query().Get(\"aggregateOperator\"))\n\tdataSource := v3.DataSource(r.URL.Query().Get(\"dataSource\"))\n\taggregateAttribute := r.URL.Query().Get(\"searchText\")\n\n\tlimit, err := strconv.Atoi(r.URL.Query().Get(\"limit\"))","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/parser.go#L454-L490","documentation":"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.","triggerScenarios":"Calling GET /api/v1/ttl (or the retention get endpoint) with no ?type= parameter.","commonSituations":"Assuming the get endpoint returns TTLs for all signals at once; frontend bug dropping the type param; manual curl without params.","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"],"exampleFix":"// before\ncurl 'http://localhost:8080/api/v1/ttl'\n// after\ncurl 'http://localhost:8080/api/v1/ttl?type=traces'","handlingStrategy":"validation","validationCode":"if r.URL.Query().Get(\"type\") == \"\" { return errors.New(\"type query param required for getTTL\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fetch TTL per signal in a loop over [traces, metrics, logs]","Build query strings with a helper that asserts required params"],"tags":["signoz","retention","ttl","query-params"],"backgroundTag":"missing-query-parameter","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}