Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDBAtlasDocumentStore errors on : "invalid parameter: expected an object (filter)" #763

Closed
Pash10g opened this issue May 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Pash10g
Copy link

Pash10g commented May 27, 2024

Describe the bug
When running the following demo collab according to Haystack docs :

https://github.com/mongodb-developer/GenAI-Showcase/blob/main/notebooks/rag/Haystack_MongoDB_Atlas_RAG.ipynb

To Reproduce
Steps to reproduce the behavior:

https://github.com/mongodb-developer/GenAI-Showcase/blob/main/notebooks/rag/Haystack_MongoDB_Atlas_RAG.ipynb

I get the following error in the last code block:

OperationFailure: invalid parameter: expected an object (filter), full error: {'ok': 0.0, 'errmsg': 'invalid parameter: expected an object (filter)', 'code': 10065, 'codeName': 'Location10065', '$clusterTime': {'clusterTime': Timestamp(1716804481, 2), 'signature': {'hash': b'\xd0\xf5\xce`6]j\xb5\xbf\xf2CN\x03\x9a3\xb2HiC\x9c', 'keyId': 7317623845651742726}}, 'operationTime': Timestamp(1716804481, 2)}



The above exception was the direct cause of the following exception:

DocumentStoreError                        Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/haystack_integrations/document_stores/mongodb_atlas/document_store.py](https://localhost:8080/#) in _embedding_retrieval(self, query_embedding, filters, top_k)
    268                     "in the `vector_search_index` configuration"
    269                 )
--> 270             raise DocumentStoreError(msg) from e
    271 
    272         documents = [self._mongo_doc_to_haystack_doc(doc) for doc in documents]

DocumentStoreError: Retrieval of documents from MongoDB Atlas failed: invalid parameter: expected an object (filter), full error: {'ok': 0.0, 'errmsg': 'invalid parameter: expected an object (filter)', 'code': 10065, 'codeName': 'Location10065', '$clusterTime': {'clusterTime': Timestamp(1716804481, 2), 'signature': {'hash': b'\xd0\xf5\xce`6]j\xb5\xbf\xf2CN\x03\x9a3\xb2HiC\x9c', 'keyId': 7317623845651742726}}, 'operationTime': Timestamp(1716804481, 2)}

I believe its an issue with the fact that now every time a "filters" element is being passed even if its none and the server does not expect that.

Describe your environment (please complete the following information):

  • OS: Google collab
  • Haystack version: latest
  • Integration version: latest
@Pash10g Pash10g added the bug Something isn't working label May 27, 2024
@Pash10g
Copy link
Author

Pash10g commented May 30, 2024

Looks like the issue was solved in a latest release.

@Pash10g Pash10g closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant