t8y2/dbx · error

read ZooKeeper connect response: %w

Error message

read ZooKeeper connect response: %w

What it means

Returned by newProtocolZooKeeperClient when the response to the initial connect request could not be read — the socket read for the handshake reply failed (EOF, reset, timeout). The ZooKeeper server accepted the TCP connection but the protocol handshake reply never arrived intact.

Source

Thrown at agents/drivers/hive-go/zookeeper_protocol.go:160

	if connection == nil {
		return nil, errors.New("ZooKeeper connection is nil")
	}
	if timeout <= 0 {
		timeout = defaultConnectTimeout
	}
	client := &protocolZooKeeperClient{connection: connection, timeout: timeout}
	request := &zooKeeperEncoder{}
	request.int32(zooKeeperProtocolVersion)
	request.int64(0)
	request.int32(zooKeeperTimeoutMillis(timeout))
	request.int64(0)
	request.bytes(make([]byte, 16))
	if err := client.writeFrame(request.data()); err != nil {
		return nil, fmt.Errorf("send ZooKeeper connect request: %w", err)
	}
	response, err := client.readFrame()
	if err != nil {
		return nil, fmt.Errorf("read ZooKeeper connect response: %w", err)
	}
	decoder := newZooKeeperDecoder(response)
	if _, err := decoder.int32(); err != nil {
		return nil, fmt.Errorf("decode ZooKeeper protocol version: %w", err)
	}
	if _, err := decoder.int32(); err != nil {
		return nil, fmt.Errorf("decode ZooKeeper session timeout: %w", err)
	}
	sessionID, err := decoder.int64()
	if err != nil {
		return nil, fmt.Errorf("decode ZooKeeper session ID: %w", err)
	}
	if _, err := decoder.bytes(); err != nil {
		return nil, fmt.Errorf("decode ZooKeeper session password: %w", err)
	}
	if sessionID == 0 {
		return nil, zk.ErrSessionExpired
	}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Verify the endpoint is actually a ZooKeeper server port and not another service
  2. Check for load balancers/proxies truncating the handshake
  3. Retry against another ensemble member
  4. Confirm ZooKeeper is not in a stalled state (check server logs/four-letter commands)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agents/drivers/hive-go/zookeeper_protocol.go:160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/5416461d7aff6c57. Report an issue: GitHub.