Help diagnosing a "Query not executed" error received by Python client


I am using OpenAI ada vectorizer for embeddings. The application I am working on sends requests to our hosted Weaviate instance through the python client (v3.11.0). We keep seeing a RequestsConnectionError Query not executed error in our logs - not for every request, but quite a few.

There is also a point in our code where we send requests asynchronously, hacked with

loop = asyncio.get_event_loop()
response = await loop.run_in_executor(None, self.client.query.raw, query)

since the client does not support async requests yet.

Would appreciate any help diagnosing why this error might be happening and any steps I could take to help mitigate it.

Thank you!

Can you share Weaviate logs with us? and the query that you are sending is a Get Aggregate or Explore?

I don’t have access to the server logs, just the client logs. This is for a Get request using the weaviate.Client.query.raw method.

What are you getting back on the client side when that error happens?

Also your python client is very old (3.20 is current), don’t think anything significantly changed for the raw queries, but might still be worth to update.

Hi @svitkin

Were you able to resolve this? Also, I’m curious as you mentioned weaviate.Client.query.raw - is your Client object instantiated?

If you were able to share your snippet from the connection to the client onwards, we can probably help better.


Hi! Yes, the client is instantiated as a global singleton across the app. So there’s only one instance of weaviate.Client that gets used for all querying in the execution environment. Do you think that’s causing an issue?

No, I just wanted to check. :slight_smile:

If you can share the full snippet for instantiation to query, it would be helpful for us to reproduce/diagnose the issue.

yep! this is the code for instantiation: weaviate.Client( host, auth_client_secret=weaviate.AuthClientPassword(username=username, password=password), additional_headers={"X-OpenAI-Api-Key": get_openai_key()}, )

and then we have a class that uses this client and given a query calls this function:

async def raw_query(self, query: str):
        """Perform async raw query on Weaviate."""
        loop = asyncio.get_event_loop()
        response = await loop.run_in_executor(None, self.client.query.raw, query)
        return response.get("data", {}).get("Get", {})

Hi! Any other information you need to diagnose this?

Hi @svitkin - if you run the query as a synchronous query, does it work?

I guess as a starting point that would help us understand whether it’s related to the async nature of the code.

(Sorry about the late reply; I’ve been away)