WeaviateQueryError: Query call with protocol GRPC search failed with message panic occurred: ValidateParam was called without any known params present

using the text search method from this example and getting WeaviateQueryError. weaviate-client version is 4.5.4 and weaviate sandbox version is 1.24.6. Although querying the local instance on Docker seems to be working fine
code:

import weaviate
import weaviate.classes as wvc

# Set these environment variables
URL = "some_url"
APIKEY = "weaviate_api_key"
  
# Connect to a WCS instance
client = weaviate.connect_to_wcs(skip_init_checks=True,
    cluster_url=URL,
    auth_credentials=weaviate.auth.AuthApiKey(APIKEY),
    headers={
        "X-Cohere-Api-Key": "cohere_api_Key"  # Replace with your inference API key
    }
    )

jeopardy = client.collections.get("JeopardyQuestion")
response = jeopardy.query.near_text(
    query="animals in movies",
    limit=2,
    return_metadata=wvc.query.MetadataQuery(distance=True)
)

for o in response.objects:
    print(o.properties)
    print(o.metadata.distance)

Traceback:

---------------------------------------------------------------------------
_InactiveRpcError                         Traceback (most recent call last)
File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\weaviate\collections\grpc\query.py:609, in _QueryGRPC.__call(self, request)
    608 res: search_get_pb2.SearchReply  # According to PEP-0526
--> 609 res, _ = self._connection.grpc_stub.Search.with_call(
    610     request,
    611     metadata=self._connection.grpc_headers(),
    612     timeout=self._connection.timeout_config.query,
    613 )
    615 return res

File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\grpc\_channel.py:1193, in _UnaryUnaryMultiCallable.with_call(self, request, timeout, metadata, credentials, wait_for_ready, compression)
   1187 (
   1188     state,
   1189     call,
   1190 ) = self._blocking(
   1191     request, timeout, metadata, credentials, wait_for_ready, compression
   1192 )
-> 1193 return _end_unary_response_blocking(state, call, True, None)

File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\grpc\_channel.py:1005, in _end_unary_response_blocking(state, call, with_call, deadline)
   1004 else:
-> 1005     raise _InactiveRpcError(state)

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "panic occurred: ValidateParam was called without any known params present"
	debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2024-04-03T07:33:51.3929187+00:00", grpc_status:2, grpc_message:"panic occurred: ValidateParam was called without any known params present"}"
>

During handling of the above exception, another exception occurred:

WeaviateQueryError                        Traceback (most recent call last)
Cell In[13], line 6
      3 client = weaviate.connect_to_local()
      5 jeopardy = client.collections.get("hopper_collection")
----> 6 response = jeopardy.query.near_text(
      7     query="animals in movies",
      8     limit=2,
      9     return_metadata=wvc.query.MetadataQuery(distance=True)
     10 )
     12 for o in response.objects:
     13     print(o.properties)

File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\weaviate\collections\queries\near_text\query.py:90, in _NearTextQuery.near_text(self, query, certainty, distance, move_to, move_away, limit, offset, auto_limit, filters, group_by, rerank, target_vector, include_vector, return_metadata, return_properties, return_references)
     25 def near_text(
     26     self,
     27     query: Union[List[str], str],
   (...)
     43     return_references: Optional[ReturnReferences[TReferences]] = None,
     44 ) -> QueryNearMediaReturnType[Properties, References, TProperties, TReferences]:
     45     """Search for objects in this collection by text using text-capable vectorization module and vector-based similarity search.
     46 
     47     See the [docs](https://weaviate.io/developers/weaviate/api/graphql/search-operators#neartext) for a more detailed explanation.
   (...)
     88             If the request to the Weaviate server fails.
     89     """
---> 90     res = self._query.near_text(
     91         near_text=query,
     92         certainty=certainty,
     93         distance=distance,
     94         move_to=move_to,
     95         move_away=move_away,
     96         limit=limit,
     97         offset=offset,
     98         autocut=auto_limit,
     99         filters=filters,
    100         target_vector=target_vector,
    101         group_by=_GroupBy.from_input(group_by),
    102         rerank=rerank,
    103         return_metadata=self._parse_return_metadata(return_metadata, include_vector),
    104         return_properties=self._parse_return_properties(return_properties),
    105         return_references=self._parse_return_references(return_references),
    106     )
    107     return self._result_to_query_or_groupby_return(
    108         res,
    109         _QueryOptions.from_input(
   (...)
    119         return_references,
    120     )

File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\weaviate\collections\grpc\query.py:418, in _QueryGRPC.near_text(self, near_text, certainty, distance, move_to, move_away, limit, offset, autocut, filters, group_by, generative, rerank, target_vector, return_metadata, return_properties, return_references)
    379 near_text_req = search_get_pb2.NearTextSearch(
    380     query=near_text,
    381     certainty=certainty,
   (...)
    401     ),
    402 )
    404 request = self.__create_request(
    405     limit=limit,
    406     offset=offset,
   (...)
    415     near_text=near_text_req,
    416 )
--> 418 return self.__call(request)

File c:\Users\deboj\anaconda3\envs\rivi_rag\Lib\site-packages\weaviate\collections\grpc\query.py:618, in _QueryGRPC.__call(self, request)
    615     return res
    617 except grpc.RpcError as e:
--> 618     raise WeaviateQueryError(e.details(), "GRPC search")

WeaviateQueryError: Query call with protocol GRPC search failed with message panic occurred: ValidateParam was called without any known params present.

Hi @Debojit_Nath,

Just to be sure, did you update the URL, APIKEYand"cohere_api_Key"` values? You don’t need to share them here :wink:

Can you check if you have any data in your collection?

hopper = client.collections.get("hopper_collection")
agg = hopper.aggregate.over_all()
print(agg)

Can you check and if they have vectors?

hopper = client.collections.get("hopper_collection")
response = hopper.query.fetch_objects(
    include_vector=True,
    limit=1
)

print(response.objects[0].properties)
print(response.objects[0].vector["default"])

during execution I had the proper api keys and urls, getting the following while checking for data

AggregateReturn(properties={}, total_count=114)

and the following while checking for vectors

{'answers': 'some answer', 'question': 'some question'}
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[4], line 8
      2 response = hopper.query.fetch_objects(
      3     include_vector=True,
      4     limit=1
      5 )
      7 print(response.objects[0].properties)
----> 8 print(response.objects[0].vector["default"])

KeyError: 'default'

seems like while inserting data to collection the vectors were not created, I’ll try the creating a new collection and make sure the vectors are created

just figured out that I wasn’t using the vectorizer while creating the collection, now it’s working as expected, thanks for the help @sebawita :hugs:

Hi @Debojit_Nath,

I am glad you were able to find the issue.

I think we should add the example to check for vectors to a troubleshooting guide. :thinking:

Good luck with your project.
I can’t wait to see what you will build. :slight_smile:

1 Like