# Help Needed: Resolving WeaviateQueryError with Nil or Zero-Length Vector at docID 715

**URL:** <https://forum.weaviate.io/t/help-needed-resolving-weaviatequeryerror-with-nil-or-zero-length-vector-at-docid-715/1876>\
**Category:** Support\
**Created:** [April 1, 2024, 11:22pm UTC](https://forum.weaviate.io/t/help-needed-resolving-weaviatequeryerror-with-nil-or-zero-length-vector-at-docid-715/1876 "2024-04-01T23:22:38Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [April 18, 2024, 6:41pm UTC](https://forum.weaviate.io/t/help-needed-resolving-weaviatequeryerror-with-nil-or-zero-length-vector-at-docid-715/1876/12 "2024-04-18T18:41:09Z")

</div>

# Edit: [version 1.24.11 fix this bug!](https://github.com/weaviate/weaviate/releases/tag/v1.24.11)

Hi there dear friends!!!

Welcome to our community @smwitkowski !! 🤗

Our team is already aware of this and were able to reproduce. Here is the GH issue:

> <https://github.com/weaviate/weaviate/issues/4692>
>
> \### 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)

Thank you all for reporting and being such an amazing community! 🫂

---

_[View the full topic](https://forum.weaviate.io/t/help-needed-resolving-weaviatequeryerror-with-nil-or-zero-length-vector-at-docid-715/1876)._
