go-redis/redis · error

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

Error message

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

What it means

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

Source

Thrown at internal/proto/reader.go:770

	line, err := r.ReadLine()
	if err != nil {
		return 0, err
	}
	switch line[0] {
	case RespMap:
		return replyLen(line)
	case RespArray, RespSet, RespPush:
		// Some commands and RESP2 protocol may respond to array types.
		n, err := replyLen(line)
		if err != nil {
			return 0, err
		}
		if n%2 != 0 {
			return 0, fmt.Errorf("redis: the length of the array must be a multiple of 2, got: %d", n)
		}
		return n / 2, nil
	default:
		return 0, fmt.Errorf("redis: can't parse map reply: %.100q", line)
	}
}

// DiscardNext read and discard the data represented by the next line.
func (r *Reader) DiscardNext() error {
	line, err := r.readLine()
	if err != nil {
		return err
	}
	return r.Discard(line)
}

// Discard the data represented by line.
func (r *Reader) Discard(line []byte) (err error) {
	if len(line) == 0 {
		return errors.New("redis: invalid line")
	}
	switch line[0] {

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Check the quoted reply; the map frame is malformed
  2. Reconnect to resynchronize

When it happens

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

Common situations: Fail the connection on malformed map frames.


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