go-redis/redis · error
invalid execution_time format: %v
Error message
invalid execution_time format: %v
What it means
Thrown in parseFTHybrid (search_commands.go:3131-3138): the optional 'execution_time' field, when present as a string, must be parseable by strconv.ParseFloat. A non-numeric string here trips this error, with the underlying ParseFloat error appended.
Source
Thrown at search_commands.go:3137
}
if ok {
warnings = make([]string, 0, len(warningsData))
for _, w := range warningsData {
if ws, ok := w.(string); ok {
warnings = append(warnings, ws)
}
}
}
// Parse execution time (optional field)
var executionTime float64
if execTimeVal, exists := resultMap["execution_time"]; exists {
switch v := execTimeVal.(type) {
case string:
var err error
executionTime, err = strconv.ParseFloat(v, 64)
if err != nil {
return FTHybridResult{}, nil, fmt.Errorf("invalid execution_time format: %v", err)
}
case float64:
executionTime = v
case int64:
executionTime = float64(v)
}
}
return FTHybridResult{
TotalResults: int(totalResults),
Results: results,
Warnings: warnings,
ExecutionTime: executionTime,
}, nil, nil
}
func (cmd *FTHybridCmd) readReply(rd *proto.Reader) (err error) {
data, err := rd.ReadSlice()View on GitHub (pinned to 36d97525cd)
Solutions
- Inspect RawResult() for the execution_time value.
- Upgrade the server module to a version emitting parseable floats.
- File a go-redis issue if a legitimate format is rejected.
- Filter execution_time at the query level if not needed.
Defensive patterns
Strategy: try-catch
Try / catch
res, _, err := client.FTHybridWithArgs(ctx, idx, opts).Result()
if err != nil && strings.Contains(err.Error(), "invalid execution_time format") {
raw, _ := cmd.RawVal()
log.Printf("fthybrid execution_time unparseable; raw=%#v", raw)
} Prevention
- Upgrade the server module so execution_time is numeric.
- Inspect RawVal() for the execution_time value.
- File a go-redis issue if a legitimate format is rejected.
When it happens
Trigger: FHybrid reply where execution_time is a string like 'N/A', 'inf', or empty, so ParseFloat fails.
Common situations: Older/newer module variant formatting execution_time differently, locale-specific decimal separators, or a proxy mangling the value.
Related errors
- invalid key type at index %d
- invalid cursor result format
- invalid total_results format
- invalid results format
- invalid result item format
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/29c8967fe9accfe6.json.
Report an issue: GitHub.