{"record":{"id":"4e4478319fba0de4","repo":"weaviate/weaviate","slug":"get-grpc-connection-to-s-w","errorCode":null,"errorMessage":"get gRPC connection to %s: %w","messagePattern":"get gRPC connection to (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/clients/replication_grpc.go","lineNumber":56,"sourceCode":"\t\"github.com/weaviate/weaviate/usecases/replica/hashtree\"\n)\n\n// grpcReplicationClient implements replica.Client using gRPC.\ntype grpcReplicationClient struct {\n\tconnManager *grpcconn.ConnManager\n}\n\nvar _ replica.Client = (*grpcReplicationClient)(nil)\n\n// NewGRPCReplicationClient creates a new gRPC-based replication client.\nfunc NewGRPCReplicationClient(connManager *grpcconn.ConnManager) *grpcReplicationClient {\n\treturn &grpcReplicationClient{connManager: connManager}\n}\n\nfunc (c *grpcReplicationClient) getClient(host string) (protocol.ReplicationServiceClient, error) {\n\tconn, err := c.connManager.GetConn(host)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get gRPC connection to %s: %w\", host, err)\n\t}\n\treturn protocol.NewReplicationServiceClient(conn), nil\n}\n\n// ── Write operations (WClient) ───────────────────────────────────────────────\n\nfunc (c *grpcReplicationClient) PutObject(ctx context.Context, host, index, shard, requestID string,\n\tobj *storobj.Object, schemaVersion uint64,\n) (replica.SimpleResponse, error) {\n\tclient, err := c.getClient(host)\n\tif err != nil {\n\t\treturn replica.SimpleResponse{}, err\n\t}\n\n\tobjData, err := obj.MarshalBinary()\n\tif err != nil {\n\t\treturn replica.SimpleResponse{}, fmt.Errorf(\"marshal object: %w\", err)\n\t}","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/clients/replication_grpc.go#L38-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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>`.","Verify the target node is up and its gRPC port is exposed (Docker `-p` mapping / Kubernetes Service + containerPort).","Review cluster join configuration (`CLUSTER_HOSTNAME`, `CLUSTER_GOSSIP_BIND_PORT`, `CLUSTER_DATA_BIND_PORT`) so nodes advertise reachable addresses.","Check firewall/network policies allowing node-to-node traffic on the gRPC port.","If TLS is used, confirm certificate and TLS settings match on both peers."],"exampleFix":"// docker-compose: expose the gRPC port so peers can dial it\n// before\nservices:\n  weaviate:\n    ports:\n      - \"8080:8080\"\n// after\nservices:\n  weaviate:\n    ports:\n      - \"8080:8080\"\n      - \"50051:50051\"  # gRPC port reachable by peers","handlingStrategy":"retry","validationCode":"func canReachGRPC(host string, port int) error {\n\tconn, err := net.DialTimeout(\"tcp\", fmt.Sprintf(\"%s:%d\", host, port), 5*time.Second)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"gRPC peer %s:%d unreachable: %w\", host, port, err)\n\t}\n\tconn.Close()\n\treturn nil\n}","typeGuard":"func isConnEstablishmentError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"get gRPC connection to\")\n}","tryCatchPattern":"resp, err := grpcClient.PutObject(ctx, host, index, shard, reqID, obj, schemaVersion)\nif err != nil {\n\tif isConnEstablishmentError(err) {\n\t\t// peer down/unreachable: retry with backoff or fail over to another replica\n\t\treturn retryWithBackoff(func() error {\n\t\t\t_, err = grpcClient.PutObject(ctx, host, index, shard, reqID, obj, schemaVersion)\n\t\t\treturn err\n\t\t})\n\t}\n\treturn err\n}","preventionTips":["Publish/expose the gRPC port in Docker/Kubernetes wherever the cluster port is required.","Set CLUSTER_HOSTNAME/advertising addresses to names resolvable by all peers.","Configure network policies/firewalls to allow node-to-node traffic on gRPC and cluster ports.","Keep TLS settings identical on all nodes.","Monitor cluster membership and re-check connectivity after node restarts."],"tags":["grpc","network","replication","connection","weaviate"],"backgroundTag":"grpc-unavailable","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}