weaviate/weaviate · error

get gRPC connection to

Error message

get gRPC connection to %s: %w

What it means

Wrapping error from `grpcReplicationClient.getClient` (adapters/clients/replication_grpc.go:56). Before every gRPC replication operation (PutObject, PutObjects, MergeObject, DeleteObject, DeleteObjects, AddReferences), the client asks the shared `ConnManager` for a connection to the target replica host; if `connManager.GetConn(host)` fails, the host name and underlying cause (DNS resolution failure, dial timeout, TLS handshake error) are wrapped into this message. No RPC is attempted — this is a pure connectivity/establishment failure to the target node's gRPC port.

Solutions

  1. Check the host address in the wrapped message (`get gRPC connection to <host>: ...`) — confirm it resolves and the peer is running: `ping`/`nslookup`/`nc -zv <host> <grpc-port>`.
  2. Verify the target node is up and its gRPC port is exposed (Docker `-p` mapping / Kubernetes Service + containerPort).
  3. Review cluster join configuration (`CLUSTER_HOSTNAME`, `CLUSTER_GOSSIP_BIND_PORT`, `CLUSTER_DATA_BIND_PORT`) so nodes advertise reachable addresses.
  4. Check firewall/network policies allowing node-to-node traffic on the gRPC port.
  5. If TLS is used, confirm certificate and TLS settings match on both peers.

Example fix

// docker-compose: expose the gRPC port so peers can dial it
// before
services:
  weaviate:
    ports:
      - "8080:8080"
// after
services:
  weaviate:
    ports:
      - "8080:8080"
      - "50051:50051"  # gRPC port reachable by peers
Defensive patterns

Strategy: retry

Validate before calling

func canReachGRPC(host string, port int) error {
	conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", host, port), 5*time.Second)
	if err != nil {
		return fmt.Errorf("gRPC peer %s:%d unreachable: %w", host, port, err)
	}
	conn.Close()
	return nil
}

Type guard

func isConnEstablishmentError(err error) bool {
	return err != nil && strings.Contains(err.Error(), "get gRPC connection to")
}

Try / catch

resp, err := grpcClient.PutObject(ctx, host, index, shard, reqID, obj, schemaVersion)
if err != nil {
	if isConnEstablishmentError(err) {
		// peer down/unreachable: retry with backoff or fail over to another replica
		return retryWithBackoff(func() error {
			_, err = grpcClient.PutObject(ctx, host, index, shard, reqID, obj, schemaVersion)
			return err
		})
	}
	return err
}

Prevention

When it happens

Trigger: Any of PutObject, PutObjects, MergeObject, DeleteObject, DeleteObjects, AddReferences invoked when: (1) the target host string is wrong/stale in the cluster state, (2) DNS can't resolve the peer's hostname, (3) the peer's gRPC port is closed, the node is down, or the container isn't exposing the gRPC port, (4) a firewall/NAT blocks the port, or (5) TLS configuration mismatches between nodes.

Common situations: Kubernetes/Docker deployments where the gRPC port (default 50051/7605-style cluster port) isn't published; `CLUSTER_HOSTNAME`/advertising misconfiguration so peers get unreachable addresses; a node removed or restarted but schema/cluster state still references the old address; network policies blocking inter-pod traffic; TLS enabled on one node but not the other.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/4e4478319fba0de4. Report an issue: GitHub.

Appendix: source

Thrown at adapters/clients/replication_grpc.go:56

	"github.com/weaviate/weaviate/usecases/replica/hashtree"
)

// grpcReplicationClient implements replica.Client using gRPC.
type grpcReplicationClient struct {
	connManager *grpcconn.ConnManager
}

var _ replica.Client = (*grpcReplicationClient)(nil)

// NewGRPCReplicationClient creates a new gRPC-based replication client.
func NewGRPCReplicationClient(connManager *grpcconn.ConnManager) *grpcReplicationClient {
	return &grpcReplicationClient{connManager: connManager}
}

func (c *grpcReplicationClient) getClient(host string) (protocol.ReplicationServiceClient, error) {
	conn, err := c.connManager.GetConn(host)
	if err != nil {
		return nil, fmt.Errorf("get gRPC connection to %s: %w", host, err)
	}
	return protocol.NewReplicationServiceClient(conn), nil
}

// ── Write operations (WClient) ───────────────────────────────────────────────

func (c *grpcReplicationClient) PutObject(ctx context.Context, host, index, shard, requestID string,
	obj *storobj.Object, schemaVersion uint64,
) (replica.SimpleResponse, error) {
	client, err := c.getClient(host)
	if err != nil {
		return replica.SimpleResponse{}, err
	}

	objData, err := obj.MarshalBinary()
	if err != nil {
		return replica.SimpleResponse{}, fmt.Errorf("marshal object: %w", err)
	}

View on GitHub (pinned to 75aa4b6d11)