go-redis/redis · error

redis: can't parse array/set/push reply: %.100q

Error message

redis: can't parse array/set/push reply: %.100q

What it means

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

Source

Thrown at internal/proto/reader.go:731

		return err
	}
	if n != fixedLen {
		return fmt.Errorf("redis: got %d elements in the array, wanted %d", n, fixedLen)
	}
	return nil
}

// ReadArrayLen Read and return the length of the array.
func (r *Reader) ReadArrayLen() (int, error) {
	line, err := r.ReadLine()
	if err != nil {
		return 0, err
	}
	switch line[0] {
	case RespArray, RespSet, RespPush:
		return replyLen(line)
	default:
		return 0, fmt.Errorf("redis: can't parse array/set/push reply: %.100q", line)
	}
}

// ReadFixedMapLen reads fixed map length.
func (r *Reader) ReadFixedMapLen(fixedLen int) error {
	n, err := r.ReadMapLen()
	if err != nil {
		return err
	}
	if n != fixedLen {
		return fmt.Errorf("redis: got %d elements in the map, wanted %d", n, fixedLen)
	}
	return nil
}

// ReadMapLen reads the length of the map type.
// If responding to the array type (RespArray/RespSet/RespPush),
// it must be a multiple of 2 and return n/2.

View on GitHub (pinned to 36d97525cd)

Solutions

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

When it happens

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

Common situations: Treat aggregate-length parse failures as connection-fatal.


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