Description
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
- Deploy the code to a Google Cloud Run environment.
- Attempt to delete entries from the Pinecone Vector Store using the
delete
function. - Observe that the retry mechanism raises an
AttributeError
due to the unexpectedstr
response fromself.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()
.