### How to reproduce this bug?
1. I have used docker to start weaviate version …1.24.8
2. Single node cluster
3. Create a multi vector schema or collection.
4. Add objects . I have added around 10k objects and could still reproduce the issue.
5. Perform `near_text` or `near_vector` query.
6. Restart the docker container
7. Run the query again
Code snippet below
```
import weaviate
import weaviate.classes.config as wvc
client = weaviate.connect_to_local(
port=8080,
grpc_port=50051,
headers={
"X-OpenAI-Api-Key": "" # Replace with your inference API key
}
)
if (client.collections.exists("NamedVector")):
# delete collection "Article" - THIS WILL DELETE THE COLLECTION AND ALL ITS DATA
client.collections.delete("NamedVector")
collection = client.collections.create(
name="NamedVector",
description="Collection of menu items with embeddings",
properties=[
wvc.Property(name="menu_item_id", data_type=wvc.DataType.TEXT),
wvc.Property(name="description", data_type=wvc.DataType.TEXT),
wvc.Property(name="name", data_type=wvc.DataType.TEXT),
],
vectorizer_config=[
wvc.Configure.NamedVectors.text2vec_openai(
name="name_embedding", source_properties=["name"]
),
wvc.Configure.NamedVectors.text2vec_openai(
name="description_embedding", source_properties=["description"]
)
],
)
# BatchImportWithNamedVectors
record = 10000
data_rows = [{
"menu_item_id": f"Object {i+1}",
"description": f"Body {i+1}",
"name": f"Body {i+1}",
} for i in range(record)]
name_vectors = [[0.12] * 1536 for _ in range(record)]
description_vectors = [[0.34] * 1536 for _ in range(record)]
menu_item_id_vectors = [[0.38] * 1536 for _ in range(record)]
collection = client.collections.get("NamedVector")
# highlight-start
with collection.batch.dynamic() as batch:
for i, data_row in enumerate(data_rows):
batch.add_object(
properties=data_row,
vector={
"name": name_vectors[i],
"description": description_vectors[i],
"menu_item_id": menu_item_id_vectors[i],
}
)
# highlight-end
# END BatchImportWithNamedVectors
from weaviate.classes.query import MetadataQuery
reviews = client.collections.get("NamedVector")
response = reviews.query.near_text(
query="Health and healthcare products",
target_vector="description_embedding", # Specify the target vector for named vector collections
return_metadata=MetadataQuery(distance=True)
)
for o in response.objects:
print(o.properties)
print(o.metadata.distance)
from weaviate.classes.query import MetadataQuery
query_vector = [1.0]* 1536
jeopardy = client.collections.get("NamedVector")
response = jeopardy.query.near_vector(
near_vector=query_vector, # your query vector goes here
target_vector="description_embedding",
return_metadata=MetadataQuery(distance=True)
)
for o in response.objects:
print(o.properties)
print(o.metadata.distance)
```
### What is the expected behavior?
No error message should be displayed and the query should work without any issues even after docker is restarted.
### What is the actual behavior?
Full stack trace below
```
{
"name": "WeaviateQueryError",
"message": "Query call with protocol GRPC search failed with message explorer: get class: vector search: object vector search at index namedvector: shard namedvector_C6ezH9Q2rHxA: vector search: knn search: distance between entrypoint and query node: got a nil or zero-length vector at docID 1115.",
"stack": "---------------------------------------------------------------------------
_InactiveRpcError Traceback (most recent call last)
File ~/Downloads/projectWorkspace/weaviate-python-client/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 ~/Downloads/projectWorkspace/pythonv4Testing/.venv/lib/python3.12/site-packages/grpc/_channel.py:1177, in _UnaryUnaryMultiCallable.with_call(self, request, timeout, metadata, credentials, wait_for_ready, compression)
1171 (
1172 state,
1173 call,
1174 ) = self._blocking(
1175 request, timeout, metadata, credentials, wait_for_ready, compression
1176 )
-> 1177 return _end_unary_response_blocking(state, call, True, None)
File ~/Downloads/projectWorkspace/pythonv4Testing/.venv/lib/python3.12/site-packages/grpc/_channel.py:1003, in _end_unary_response_blocking(state, call, with_call, deadline)
1002 else:
-> 1003 raise _InactiveRpcError(state)
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
\tstatus = StatusCode.UNKNOWN
\tdetails = \"explorer: get class: vector search: object vector search at index namedvector: shard namedvector_C6ezH9Q2rHxA: vector search: knn search: distance between entrypoint and query node: got a nil or zero-length vector at docID 1115\"
\tdebug_error_string = \"UNKNOWN:Error received from peer {created_time:\"2024-04-17T16:12:32.705521+05:30\", grpc_status:2, grpc_message:\"explorer: get class: vector search: object vector search at index namedvector: shard namedvector_C6ezH9Q2rHxA: vector search: knn search: distance between entrypoint and query node: got a nil or zero-length vector at docID 1115\"}\"
>
During handling of the above exception, another exception occurred:
WeaviateQueryError Traceback (most recent call last)
/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb Cell 8 line 5
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=2'>3</a> query_vector = [1.0]* 1536
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=3'>4</a> jeopardy = client.collections.get(\"NamedVector\")
----> <a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=4'>5</a> response = jeopardy.query.near_vector(
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=5'>6</a> near_vector=query_vector, # your query vector goes here
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=6'>7</a> target_vector=\"description_embedding\",
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=7'>8</a> return_metadata=MetadataQuery(distance=True)
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=8'>9</a> )
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=10'>11</a> for o in response.objects:
<a href='vscode-notebook-cell:/Users/aarthiiyer/Downloads/projectWorkspace/pythonv4Testing/alltius/multivector-search.ipynb#W6sZmlsZQ%3D%3D?line=11'>12</a> print(o.properties)
File ~/Downloads/projectWorkspace/weaviate-python-client/weaviate/collections/queries/near_vector/query.py:80, in _NearVectorQuery.near_vector(self, near_vector, certainty, distance, limit, offset, auto_limit, filters, group_by, rerank, target_vector, include_vector, return_metadata, return_properties, return_references)
20 def near_vector(
21 self,
22 near_vector: List[float],
(...)
36 return_references: Optional[ReturnReferences[TReferences]] = None,
37 ) -> QueryNearMediaReturnType[Properties, References, TProperties, TReferences]:
38 \"\"\"Search for objects by vector in this collection using and vector-based similarity search.
39
40 See the [docs](https://weaviate.io/developers/weaviate/search/similarity) for a more detailed explanation.
(...)
78 If the request to the Weaviate server fails.
79 \"\"\"
---> 80 res = self._query.near_vector(
81 near_vector=near_vector,
82 certainty=certainty,
83 distance=distance,
84 limit=limit,
85 offset=offset,
86 autocut=auto_limit,
87 filters=filters,
88 group_by=_GroupBy.from_input(group_by),
89 rerank=rerank,
90 target_vector=target_vector,
91 return_metadata=self._parse_return_metadata(return_metadata, include_vector),
92 return_properties=self._parse_return_properties(return_properties),
93 return_references=self._parse_return_references(return_references),
94 )
95 return self._result_to_query_or_groupby_return(
96 res,
97 _QueryOptions.from_input(
(...)
107 return_references,
108 )
File ~/Downloads/projectWorkspace/weaviate-python-client/weaviate/collections/grpc/query.py:296, in _QueryGRPC.near_vector(self, near_vector, certainty, distance, limit, offset, autocut, filters, group_by, generative, rerank, target_vector, return_metadata, return_properties, return_references)
275 certainty, distance = self.__parse_near_options(certainty, distance)
277 request = self.__create_request(
278 limit=limit,
279 offset=offset,
(...)
293 ),
294 )
--> 296 return self.__call(request)
File ~/Downloads/projectWorkspace/weaviate-python-client/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 explorer: get class: vector search: object vector search at index namedvector: shard namedvector_C6ezH9Q2rHxA: vector search: knn search: distance between entrypoint and query node: got a nil or zero-length vector at docID 1115."
}
```
### Supporting information
Forum link : https://forum.weaviate.io/t/help-needed-resolving-weaviatequeryerror-with-nil-or-zero-length-vector-at-docid-715/1876/2
Also, the issue is seen only in Multi vector class. The only way for now to fix the issue is to reindex the objects.
### Server Version
1.24.8
### Code of Conduct
- [X] I have read and agree to the Weaviate's [Contributor Guide](https://weaviate.io/developers/contributor-guide) and [Code of Conduct](https://weaviate.io/service/code-of-conduct)