t8y2/dbx · error

ZooKeeper SASL round %d: %w

Error message

ZooKeeper SASL round %d: %w

What it means

Returned by protocolZooKeeperClient.authenticateSASL when sending a SASL request frame to ZooKeeper fails at round N (zooKeeperOpSASL request). This is the transport-level write/read of the negotiation round; the wrapped error carries the I/O cause (closed socket, timeout) after GSSAPI started successfully.

Source

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

func (client *protocolZooKeeperClient) authenticateSASL(saslClient zooKeeperSASLClient) error {
	if saslClient == nil {
		return errors.New("ZooKeeper SASL client is nil")
	}
	defer saslClient.Dispose()
	token, err := saslClient.Start()
	if err != nil {
		return fmt.Errorf("start ZooKeeper GSSAPI negotiation: %w", err)
	}
	for round := 0; round < zooKeeperMaxSASLRounds; round++ {
		response, requestErr := client.request(zooKeeperOpSASL, func(encoder *zooKeeperEncoder) {
			if token == nil {
				encoder.bytes([]byte{})
				return
			}
			encoder.bytes(token)
		})
		if requestErr != nil {
			return fmt.Errorf("ZooKeeper SASL round %d: %w", round+1, requestErr)
		}
		decoder := newZooKeeperDecoder(response)
		challenge, decodeErr := decoder.bytes()
		if decodeErr != nil {
			return fmt.Errorf("decode ZooKeeper SASL round %d: %w", round+1, decodeErr)
		}
		if saslClient.Complete() {
			if len(challenge) != 0 {
				return errors.New("ZooKeeper sent an unexpected token after GSSAPI completion")
			}
			return nil
		}
		token, err = saslClient.Step(challenge)
		if err != nil {
			return fmt.Errorf("continue ZooKeeper GSSAPI negotiation at round %d: %w", round+1, err)
		}
	}
	return fmt.Errorf("ZooKeeper GSSAPI negotiation exceeded %d rounds", zooKeeperMaxSASLRounds)

View on GitHub (pinned to c0390bff16)

Solutions

  1. Check ZooKeeper session liveness — the connection may have been dropped mid-negotiation
  2. Increase the connect/session timeout if negotiation rounds are slow
  3. Inspect the wrapped error for network-level causes and retry the connection
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agents/drivers/hive-go/zookeeper_protocol.go:211 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/3a859873a01e4bd0. Report an issue: GitHub.