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

[Bug] AttributeError in Pinecone VectorStore Delete Function on Google Cloud Run Environment #408

Open
2 tasks done
gildemberg-santos opened this issue Oct 30, 2024 · 1 comment
Labels
bug Something isn't working status:needs-triage An issue that needs to be triaged by the Pinecone team

Comments

@gildemberg-santos
Copy link

gildemberg-santos commented Oct 30, 2024

Is this a new bug?
In other words: Is this an error, flaw, failure or fault? Please search Github issues and check our Community Forum to see if someone has already reported the bug you encountered.

If this is a request for help or troubleshooting code in your own Pinecone project, please join the Pinecone Community Forum.

  • I believe this is a new bug
  • I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug

Describe the bug
The delete function in the Pinecone Vector Store raises an AttributeError when running on Google Cloud Run. The error occurs inside the tenacity retry mechanism due to self.index.list() unexpectedly returning a str instead of the expected response format containing the vectors attribute. This error only appears in production on Google Cloud Run, while the same operation works successfully locally on a Fedora Linux environment.


Error information

RetryError[<Future at 0x3ee6ff794dc0 state=finished raised AttributeError>]

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
  File "/code/vector_store/providers/pinecone_vectorstore.py", line 150, in delete
    return self._delete_by_ids(ids)
  File "/code/vector_store/providers/pinecone_vectorstore.py", line 189, in _delete_by_ids
    raise e
  File "/code/vector_store/providers/pinecone_vectorstore.py", line 183, in _delete_by_ids
    ids_to_delete = list(self.index.list(prefix=id, limit=100))
  File "/usr/local/lib/python3.10/site-packages/pinecone/data/index.py", line 621, in list
    if len(results.vectors) > 0:
AttributeError: 'str' object has no attribute 'vectors'

Steps to reproduce the issue locally

  1. Deploy the code to a Google Cloud Run environment.
  2. Attempt to delete entries from the Pinecone Vector Store using the delete function.
  3. Observe that the retry mechanism raises an AttributeError due to the unexpected str response from self.index.list().

Environment

  • OS Version: Fedora Linux (local), Google Cloud Run (production)
  • Python version: 3.10
  • Pinecone SDK version: ^5.3.1
  • Tenacity version: 8.2.3

Additional context
This issue may also affect other vector store functions that rely on self.index.list().

@gildemberg-santos gildemberg-santos added the bug Something isn't working label Oct 30, 2024
@github-actions github-actions bot added the status:needs-triage An issue that needs to be triaged by the Pinecone team label Oct 30, 2024
@jhamon
Copy link
Collaborator

jhamon commented Nov 7, 2024

Thanks for the report. I'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:needs-triage An issue that needs to be triaged by the Pinecone team
Projects
None yet
Development

No branches or pull requests

2 participants