ERR Protocol error: invalid multibulk length: Protocol error: invalid multibulk length (프로토콜 오류: 유효하지 않은 multibulk 길이)
Redis의미
Redis 서버가 클라이언트에서 온 바이트 스트림을 RESP(Redis Serialization Protocol)에 따라 파싱할 수 없었다. multibulk 명령이 선언한 요소 수가 유효하지 않아 프로토콜 오류로 연결이 닫혔다.
원인
보통 Redis가 아닌 클라이언트(예: HTTP 요청, 잘못된 포트에 연결한 애플리케이션)가 Redis 포트에 원시 데이터를 보내거나, 깨진/불완전한 클라이언트 라이브러리, pipeline의 잘못된 프레이밍, 프로토콜 한도(proto-max-bulk-len)를 넘는 거대한 요청이 원인이다.
해결 방법
실제 Redis 클라이언트만 Redis 포트에 연결하는지 확인한다(잘못 들어온 HTTP/기타 프로토콜 트래픽 없음). 클라이언트 라이브러리를 업데이트하고 RESP 프레이밍을 깨는 사용자 정의/수동 명령 생성을 피한다. 매우 큰 값을 보낸다면 proto-max-bulk-len 한도와 요청 크기를 검토한다. 네트워크의 중간 프록시가 데이터를 손상시키지 않는지 확인한다.
같은 데이터베이스의 다른 항목
- ERR wrong number of arguments for commandWrong number of arguments for command
- ERR Background save already in progressBackground save already in progress
- ERR bit offset is not an integer or out of rangeBit offset is not an integer or out of range (비트 오프셋이 정수가 아니거나 범위를 벗어남)
- ERR Number of keys can't be greater than number of argsEVAL/EVALSHA: numkeys exceeds argument count (numkeys가 인수 개수를 초과)
- ERR WATCH inside MULTI is not allowedWATCH inside MULTI is not allowed
- ERR WAIT cannot be used with replica instancesWAIT cannot be used with replica instances (replica 인스턴스에서는 WAIT 사용 불가)
- ERR Background append only file rewriting already in progressAOF rewrite already in progress