Upgrading to V4 Client - Custom Connect

Description

Hi I am trying to upgrade to the V4 client to communicate with my weaviate instance. My weaviate instance has an architecture built within AWS, at a high level, of API Gateway → EKS. With the V3 client we can connect just fine with

client = weaviate.Client(
    url="https://{DOMAIN_NAME_HERE}",
    timeout_config=(30, 600)
)

However when I try the V4 client

 client = weaviate.connect_to_custom(
            http_host="{SAME_DOMAIN_NAME}",
            http_port=443,
            http_secure=True,
            grpc_host="localhost",
            grpc_port=50051,
            grpc_secure=False,
        )

I get an error

Weaviate v1.28.0 makes use of a high-speed gRPC API as well as a REST API.
Unfortunately, the gRPC health check against Weaviate could not be completed.

This error could be due to one of several reasons:

  • The gRPC traffic at the specified port is blocked by a firewall.
  • gRPC is not enabled or incorrectly configured on the server or the client.
    • Please check that the server address and port (localhost:50051) are correct.
  • your connection is unstable or has a high latency. In this case you can:
    • increase init-timeout in weaviate.connect_to_local(additional_config=wvc.init.AdditionalConfig(timeout=wvc.init.Timeout(init=X)))
    • disable startup checks by connecting using skip_init_checks=True

Server Setup Information

  • Weaviate Server Version: 1.28.0
  • Deployment Method: APIG → EKS via CDK
  • Multi Node? Number of Running Nodes: 1
  • Client Language and Version: Python migrating from V3 to V4
  • Multitenancy?: Yes

Any additional Information

Just calling out we have a custom setup, are the grpc fields required? I am not sure I can set these up via API Gateway

Hi @JLiz2803 !!

You need to make sure you have a working GRPC connection exposed in grpc_host at port grpc_port

You can test this with grpcurl:

# lets test our grpc connection
❯ wget https://raw.githubusercontent.com/grpc/grpc/master/src/proto/grpc/health/v1/health.proto
❯ grpcurl -d '{"service": "Weaviate"}' -proto health.proto grpc.weaviate.mydomain.com:50051 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

Let me know if this helps!

Thanks for your response, I did run the command, but it does not help too much as I already knew I could not access my grpc port. It looks like I have an older version of the yaml file and have not even exposed the grpc port when deploying to kubernetes. I tried adding

grpcService:
  enabled: true  # ⬅️ Make sure this is set to true
  name: weaviate-grpc
  ports:
    - name: grpc
      protocol: TCP
      port: 50051
  type: LoadBalancer  # ⬅️ Set this to LoadBalancer (from NodePort)

to my manifest file, but receive an error on deployment

Received response status [FAILED] from custom resource. Message returned: Error: b’coalesce.go:289: warning: destination for weaviate.grpcService.ports is a table. Ignoring non-table value ([map[name:grpc port:50051 protocol:TCP]])\nError: UPGRADE FAILED: YAML parse error on weaviate/templates/weaviateServiceGRPC.yaml: error converting YAML to JSON: yaml: line 14: mapping values are not allowed in this context\n’

Even if this did work I would then have to expose two endpoints via API gateway, one for https and one for grpc.

My question is, is the grpc port required to upgrade to V4 of the client, and if so why, because my https endpoint has been working really well with the V3 client.