{"record":{"id":"bfa41e353a949e2f","repo":"redis/go-redis","slug":"redis-invalid-timeseries-aggregator-at-index-d-bfa41e","errorCode":null,"errorMessage":"redis: invalid timeseries aggregator at index %d[%d]: %d","messagePattern":"redis: invalid timeseries aggregator at index (.+?)\\[(.+?)\\]: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"timeseries_commands.go","lineNumber":1394,"sourceCode":"// lists one or more aggregators for its key and is emitted as a single comma-joined wire\n// token; specs for different keys are separate wire tokens.\nfunc buildNRangeAggregationArgs(keys []string, aggregators [][]Aggregator) ([]string, error) {\n\tif len(aggregators) != len(keys) {\n\t\treturn nil, fmt.Errorf(\"redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator spec(s), got %d\", len(keys), len(aggregators))\n\t}\n\tparts := make([]string, len(aggregators))\n\tfor i, spec := range aggregators {\n\t\tif len(spec) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"redis: empty timeseries aggregator spec at index %d\", i)\n\t\t}\n\t\tnames := make([]string, len(spec))\n\t\tfor j, agg := range spec {\n\t\t\tif agg == Invalid {\n\t\t\t\treturn nil, fmt.Errorf(\"redis: invalid timeseries aggregator at index %d[%d]: Invalid (%d)\", i, j, agg)\n\t\t\t}\n\t\t\ts := agg.String()\n\t\t\tif s == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"redis: invalid timeseries aggregator at index %d[%d]: %d\", i, j, agg)\n\t\t\t}\n\t\t\tnames[j] = s\n\t\t}\n\t\tparts[i] = strings.Join(names, \",\")\n\t}\n\treturn parts, nil\n}\n\n// appendNRangeOptions appends optional TS.NRANGE / TS.NREVRANGE arguments to args.\nfunc appendNRangeOptions(\n\targs []interface{},\n\tkeys []string,\n\tlatest bool,\n\tfilterByTS []int,\n\tfilterByValue []float64,\n\tcount int,\n\talign interface{},\n\taggregators [][]Aggregator,","sourceCodeStart":1376,"sourceCodeEnd":1412,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/timeseries_commands.go#L1376-L1412","documentation":"Error \"redis: invalid timeseries aggregator at index %d[%d]: %d\" thrown in redis/go-redis.","triggerScenarios":"Thrown at timeseries_commands.go:1394 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}