go-redis/redis · error

redis: can't parse uint reply: %.100q

Error message

redis: can't parse uint reply: %.100q

What it means

Error "redis: can't parse uint reply: %.100q" thrown in go-redis/redis.

Source

Thrown at internal/proto/reader.go:543

	case RespInt, RespStatus:
		return util.ParseUint(line[1:], 10, 64)
	case RespString:
		s, err := r.readStringReply(line)
		if err != nil {
			return 0, err
		}
		return util.ParseUint([]byte(s), 10, 64)
	case RespBigInt:
		b, err := r.readBigInt(line)
		if err != nil {
			return 0, err
		}
		if !b.IsUint64() {
			return 0, fmt.Errorf("bigInt(%s) value out of range", b.String())
		}
		return b.Uint64(), nil
	}
	return 0, fmt.Errorf("redis: can't parse uint reply: %.100q", line)
}

func (r *Reader) ReadFloat() (float64, error) {
	line, err := r.ReadLine()
	if err != nil {
		return 0, err
	}
	switch line[0] {
	case RespFloat:
		return r.readFloat(line)
	case RespStatus:
		return strconv.ParseFloat(util.BytesToString(line[1:]), 64)
	case RespString:
		s, err := r.readStringReply(line)
		if err != nil {
			return 0, err
		}
		return strconv.ParseFloat(s, 64)

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Verify the reply is a non-negative integer within uint range
  2. Reconnect on desync

When it happens

Trigger: Thrown at internal/proto/reader.go:543 when the library encounters an invalid state.

Common situations: Use signed parsing when negative values are possible and validate afterwards.


AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06). Data as JSON: /data/errors/127bac061c44c117.json. Report an issue: GitHub.