go-redis/redis · error

redis: can't parse push notification name: %q

Error message

redis: can't parse push notification name: %q

What it means

Error "redis: can't parse push notification name: %q" thrown in go-redis/redis.

Source

Thrown at internal/proto/reader.go:217

	}
	if !ok {
		return "", false, nil
	}
	// Reject ">\r\n": RESP requires at least one digit for the array length.
	// Without this check the empty length looks like a valid prefix and the
	// caller would block fetching more bytes for a frame that is already
	// malformed.
	if pos-2 == arrayLenStart {
		return "", false, fmt.Errorf("redis: empty push notification array length")
	}

	// First element type byte: '$' (bulk) or '+' (simple-string).
	if pos >= len(buf) {
		return "", false, nil
	}
	typeOfName := buf[pos]
	if typeOfName != RespString && typeOfName != RespStatus {
		return "", false, fmt.Errorf("redis: can't parse push notification name: %q", buf[pos:])
	}
	pos++

	if typeOfName == RespString {
		// Read "$M\r\n" then the M-byte name.
		lenStart := pos
		next, ok, err := skipDigitsThenCRLF(buf, pos)
		if err != nil {
			return "", false, fmt.Errorf("redis: can't parse push notification name length: %w", err)
		}
		if !ok {
			return "", false, nil
		}
		if next-2 == lenStart {
			return "", false, fmt.Errorf("redis: empty push notification name length")
		}
		nameLen, err := util.Atoi(buf[lenStart : next-2])
		if err != nil {

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Check the server/proxy emitting the notification name; the quoted value in the error shows what was received
  2. Reconnect to resynchronize the frame stream

When it happens

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

Common situations: On any push parse error, close the connection rather than continuing a desynchronized stream.


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