gRPC is not available. Please make sure that gRPC is configured correctly in the client and on the server: Weaviate v1.23.10

Description

for some reason every time I run my Python server I run into this error a retry solves the problem 80% of the time but this still breaks and causes errors

I have tried using the manual connection of weaviate but ran into too many problems and went back to the normal client connection

Server Setup Information

this is my get client

def get_client():
max_retries = 7
retry_delay_seconds = 2
for attempt in range(1, max_retries + 1):
try:
client = weaviate.connect_to_wcs(
cluster_url=WCS_CLUSTER_URL,
auth_credentials=weaviate.auth.AuthApiKey(WCS_API_KEY),
headers={“X-OpenAI-Api-Key”: OPENAI_APIKEY}
)
return client
except Exception as e:
# to see the error that get_client is giving unfortunately weaviate is broken
print(f"Attempt {attempt} failed with error: {str(e)}“)
if attempt < max_retries:
print(f"Retrying in {retry_delay_seconds} seconds…”)
time.sleep(retry_delay_seconds)

return {"error": "Failed to connect after multiple attempts."}

the error
gRPC is not available. Please make sure that gRPC is configured correctly in the client and on the server: Weaviate v1.23.10

  • Weaviate Server Version: Weaviate v1.23.10
  • Deployment Method: running on was but this is done locally as the same error happens on both was and local
  • Multi Node? Number of Running Nodes:
  • Client Language and Version: python 3.10.11

Hi! Welcome to our community :hugs:

Can you try updating the client to latest python v4 client?

Note: the v4 has the v3 inside, so your code should still work.

Hi duda sort off confused with what u reffer to but if you are reffering to the code to version 4 this is the code we used from your documentation and added some headers to the code the retry is there since I run into the grpc error and it solves the error by retrying.
The client library I’m using for weaviate-client is the latest client as well using pip list weaviate-client 4.5.1
I have ran out of ideas for this

Oh, really sorry.

I went only with the version in the initial topic :slight_smile:

Can you add skip_init_checks=True in connect_to_wcs

There is a hard coded value on those checks that waits only for 1 second for the GRPC server to answer. Some locations might have a bigger latency, and will go beyond those 1 second.

We are working to make it tunable.

Please, on this case, if you could ping me in our slack:
https://weaviate.io/slack

I would love to take a closer look on that. Thanks!

1 Like