Skip to content

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

Open
@gildemberg-santos

Description

@gildemberg-santos

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-triageAn issue that needs to be triaged by the Pinecone team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions