redis/go-redis · error
redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator
Error message
redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator spec(s), got %d
What it means
Error "redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator spec(s), got %d" thrown in redis/go-redis.
Source
Thrown at timeseries_commands.go:1380
if cmd.val[i].Values != nil {
val[i].Values = make([]float64, len(cmd.val[i].Values))
copy(val[i].Values, cmd.val[i].Values)
}
}
}
return &TSNRangePivotRowSliceCmd{
baseCmd: cmd.cloneBaseCmd(),
val: val,
}
}
// buildNRangeAggregationArgs validates and returns one aggregator spec string per key for
// TS.NRANGE / TS.NREVRANGE. The number of specs must equal the number of keys. Each spec
// lists one or more aggregators for its key and is emitted as a single comma-joined wire
// token; specs for different keys are separate wire tokens.
func buildNRangeAggregationArgs(keys []string, aggregators [][]Aggregator) ([]string, error) {
if len(aggregators) != len(keys) {
return nil, fmt.Errorf("redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator spec(s), got %d", len(keys), len(aggregators))
}
parts := make([]string, len(aggregators))
for i, spec := range aggregators {
if len(spec) == 0 {
return nil, fmt.Errorf("redis: empty timeseries aggregator spec at index %d", i)
}
names := make([]string, len(spec))
for j, agg := range spec {
if agg == Invalid {
return nil, fmt.Errorf("redis: invalid timeseries aggregator at index %d[%d]: Invalid (%d)", i, j, agg)
}
s := agg.String()
if s == "" {
return nil, fmt.Errorf("redis: invalid timeseries aggregator at index %d[%d]: %d", i, j, agg)
}
names[j] = s
}
parts[i] = strings.Join(names, ",")View on GitHub (pinned to c5cad058c7)
When it happens
Trigger: Thrown at timeseries_commands.go:1380 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of redis/go-redis@c5cad058c7 (2026-09-01).
Data as JSON: /api/errors/fb4ccfe4f7fadb26.
Report an issue: GitHub.