{"record":{"id":"c7da1167236a6cd7","repo":"SigNoz/signoz","slug":"not-a-valid-tocold-ttl-duration-v","errorCode":null,"errorMessage":"not a valid toCold TTL duration %v","messagePattern":"not a valid toCold TTL duration (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/query-service/app/parser.go","lineNumber":452,"sourceCode":"\n\t// Validate the type parameter\n\tif typeTTL != retentiontypes.TraceTTL && typeTTL != retentiontypes.MetricsTTL && typeTTL != retentiontypes.LogsTTL {\n\t\treturn nil, fmt.Errorf(\"type param should be metrics|traces|logs, got %v\", typeTTL)\n\t}\n\n\t// Validate the TTL duration.\n\tdurationParsed, err := time.ParseDuration(delDuration)\n\tif err != nil || durationParsed.Seconds() <= 0 {\n\t\treturn nil, fmt.Errorf(\"not a valid TTL duration %v\", delDuration)\n\t}\n\n\tvar toColdParsed time.Duration\n\n\t// If some cold storage is provided, validate the cold storage move TTL.\n\tif len(coldStorage) > 0 {\n\t\ttoColdParsed, err = time.ParseDuration(toColdDuration)\n\t\tif err != nil || toColdParsed.Seconds() <= 0 {\n\t\t\treturn nil, fmt.Errorf(\"not a valid toCold TTL duration %v\", toColdDuration)\n\t\t}\n\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","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/parser.go#L434-L470","documentation":"When a 'coldStorage' query parameter is present, a 'toColdDuration' must also be supplied and be a valid positive Go duration. This controls when data moves to cold storage, so an unparseable or non-positive value is rejected.","triggerScenarios":"Setting ?coldStorage=s3-bucket without toColdDuration, or with toColdDuration=0 / toColdDuration=abc / a bare number.","commonSituations":"Enabling cold storage tiering but forgetting the migration age; passing toColdDuration as milliseconds integer; partial copy-paste of the cold-storage API call.","solutions":["Supply toColdDuration in Go duration format, e.g. toColdDuration=24h","Ensure it is strictly positive","Only send coldStorage/toColdDuration when a cold storage backend is actually configured"],"exampleFix":"// before\n?type=traces&duration=72h&coldStorage=s3\n// after\n?type=traces&duration=72h&coldStorage=s3&toColdDuration=24h","handlingStrategy":"validation","validationCode":"if coldStorage != \"\" {\n  d, err := time.ParseDuration(toColdDuration)\n  if err != nil || d <= 0 { return fmt.Errorf(\"toColdDuration must be a positive Go duration\") }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat coldStorage and toColdDuration as a mandatory pair","Copy working cold-storage URL examples from docs"],"tags":["signoz","retention","cold-storage","duration-parsing"],"backgroundTag":"invalid-duration-format","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}