{"id":"7bb579c494ad2b51","repo":"go-redis/redis","slug":"redis-can-t-parse-reply-100q-reading-string-int","errorCode":null,"errorMessage":"redis: can't parse reply=%.100q reading string into buffer","messagePattern":"redis: can't parse reply=%\\.100q reading string into buffer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/proto/reader.go","lineNumber":664,"sourceCode":"\t\t// Slow path: buffer is exactly large enough for the payload only, so\n\t\t// read the payload into it and discard the CRLF separately.\n\t\tif _, err := io.ReadFull(r.rd, buf[:n]); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif _, err := r.rd.Discard(2); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\treturn n, nil\n\n\tcase RespInt, RespFloat:\n\t\ts := line[1:]\n\t\tif len(s) > len(buf) {\n\t\t\treturn 0, fmt.Errorf(\"redis: buffer too small: need %d bytes, have %d\", len(s), len(buf))\n\t\t}\n\t\treturn copy(buf, s), nil\n\t}\n\n\treturn 0, fmt.Errorf(\"redis: can't parse reply=%.100q reading string into buffer\", line)\n}\n\nfunc (r *Reader) ReadString() (string, error) {\n\tline, err := r.ReadLine()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tswitch line[0] {\n\tcase RespStatus, RespInt, RespFloat:\n\t\treturn string(line[1:]), nil\n\tcase RespString:\n\t\treturn r.readStringReply(line)\n\tcase RespBool:\n\t\tb, err := r.readBool(line)\n\t\treturn strconv.FormatBool(b), err\n\tcase RespVerbatim:\n\t\treturn r.readVerb(line)","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/internal/proto/reader.go#L646-L682","documentation":"Error \"redis: can't parse reply=%.100q reading string into buffer\" thrown in go-redis/redis.","triggerScenarios":"Thrown at internal/proto/reader.go:664 when the library encounters an invalid state.","commonSituations":"Validate frame type before buffered string reads.","solutions":["Check the quoted reply; it is not a valid string frame for buffered reading","Reconnect to resynchronize"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}