WeaviateQueryError: Query call with protocol GRPC search failed with message Socket closed

Server

I have weaviate hosted on k8s with grpc enabled as follows:

# The service controls how weaviate gRPC endpoint is exposed to the outside world.
# If you don't want a public load balancer, you can also choose 'ClusterIP' to make
# weaviate gRPC port be only accessible within your cluster.
grpcService:
  # Set this to true in order to deploy Weaviate gRPC service
  enabled: true
  name: weaviate-grpc
  ports:
    - name: grpc
      protocol: TCP
      port: 50052
      # Target port is going to be the same for every port
  type: LoadBalancer
  loadBalancerSourceRanges: []
  # optionally set cluster IP if you want to set a static IP
  clusterIP:
  annotations: {}
NAME                        TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)           AGE
service/weaviate            LoadBalancer   a.b.c.d   e.f.g.h   80:30357/TCP      8d
service/weaviate-grpc       LoadBalancer   i.j.k.l   m.n.o.p  50052:31927/TCP   8d
service/weaviate-headless   ClusterIP      None           <none>          80/TCP            8d

Client

I’m on weaviate-client-4.4b8 python client.

When I try to query weaviate with bm25 or hybrid search using the python v4 client I am getting following error:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Socket closed"
	debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"Socket closed", grpc_status:14, created_time:"2024-01-27T19:46:26.102631-05:00"}"
>

During handling of the above exception, another exception occurred:

WeaviateQueryError                        Traceback (most recent call last)
.
.
.
  561     return res
    563 except grpc.RpcError as e:
--> 564     raise WeaviateQueryError(e.details(), "GRPC search")

WeaviateQueryError: Query call with protocol GRPC search failed with message Socket closed.

I am instantiating weaviate as follows:

target_client = weaviate.connect_to_custom(
    http_host="e.f.g.h",
    http_port="80",
    http_secure=False,
    grpc_host="m.n.o.p",
    grpc_port="50052",
    grpc_secure=False,
    auth_credentials=AuthApiKey("xxxxxxxxxx")
)

Any help is appreciated. Thank you.

Hi @vamsi.

Were you able to fix this?

Weaviate Python v4 Client is now available. Also, make sure to run it with the latest Weaviate server, so you need to change the tag in your values.yml too

You shouldn’t have any issues deploying on K8s with our helm chart, unless your loadbalancer is interfering.

Let me know if I can help.

Thanks!

This issue has been resolved with the latest versions of python client and weaviate @DudaNogueira . Thanks for the help

1 Like