{"record":{"id":"777912dc0e371214","repo":"redis/go-redis","slug":"invalid-execution-time-format-v","errorCode":null,"errorMessage":"invalid execution_time format: %v","messagePattern":"invalid execution_time format: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"search_commands.go","lineNumber":3137,"sourceCode":"\t}\n\tif ok {\n\t\twarnings = make([]string, 0, len(warningsData))\n\t\tfor _, w := range warningsData {\n\t\t\tif ws, ok := w.(string); ok {\n\t\t\t\twarnings = append(warnings, ws)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse execution time (optional field)\n\tvar executionTime float64\n\tif execTimeVal, exists := resultMap[\"execution_time\"]; exists {\n\t\tswitch v := execTimeVal.(type) {\n\t\tcase string:\n\t\t\tvar err error\n\t\t\texecutionTime, err = strconv.ParseFloat(v, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn FTHybridResult{}, nil, fmt.Errorf(\"invalid execution_time format: %v\", err)\n\t\t\t}\n\t\tcase float64:\n\t\t\texecutionTime = v\n\t\tcase int64:\n\t\t\texecutionTime = float64(v)\n\t\t}\n\t}\n\n\treturn FTHybridResult{\n\t\tTotalResults:  int(totalResults),\n\t\tResults:       results,\n\t\tWarnings:      warnings,\n\t\tExecutionTime: executionTime,\n\t}, nil, nil\n}\n\nfunc (cmd *FTHybridCmd) readReply(rd *proto.Reader) (err error) {\n\treadType, err := rd.PeekReplyType()","sourceCodeStart":3119,"sourceCodeEnd":3155,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/search_commands.go#L3119-L3155","documentation":"The FT.HYBRID parser reads the optional \"execution_time\" field as a string (parsed as float) or a numeric float64/int64. If it is a string that fails strconv.ParseFloat, this error is returned wrapping the parse error. Any other type is silently ignored (execution time stays 0), so this error specifically means the time string was malformed.","triggerScenarios":"Calling FTHybrid when the server/proxy returns \"execution_time\" as a non-numeric string (e.g. \"\" or a formatted string like \"1.2ms\" instead of \"1.2\").","commonSituations":"Server builds that format execution time with units; proxies stringifying values; test fixtures with realistic-looking but unparsable strings.","solutions":["Upgrade go-redis/server so the execution_time string format matches (plain seconds float)","Strip units before the reply reaches the client if a proxy adds them","Set execution_time as float64 in test fixtures","Ignore-safe: if only diagnostics matter, strip the field via a ProcessHook"],"exampleFix":"// before (fixture)\n\"execution_time\": \"1.23ms\"\n// after\n\"execution_time\": \"1.23\"","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, _, err := hybridCmd.Result()\nif err != nil {\n    if strings.Contains(err.Error(), \"invalid execution_time format\") {\n        // non-fatal: retry once without relying on diagnostics, or log and degrade\n        log.Warn(\"malformed execution_time in FT.HYBRID reply\")\n        return runHybridIgnoringDiagnostics(ctx)\n    }\n    return err\n}","preventionTips":["Upgrade to a go-redis/server combo where execution_time is a plain float string","If a proxy adds units to timing values, strip them server-side","Use float64 execution_time in fixtures"],"tags":["redis","search","parsing","resp-protocol"],"backgroundTag":"unexpected-response-shape","analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}