Skip to content

[Bug] index.list() error message for non-serverless indexes is unclear #331

Closed

Description

@shamussim-ai

Is this a new bug in the Pinecone Python client?

  • I believe this is a new bug in the Pinecone Python Client
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I followed the code exactly from the documentation

from pinecone import Pinecone

pc = Pinecone(api_key='34zzzzzzzzzz')
index = pc.Index('self-retriever-pae')

# To iterate over all result pages using a generator function
for ids in index.list( namespace="Non_Varicea"):
    print(ids)

This succeeds (as expected) against a serverless index, but when run on a pod-based index (which indeed does not support list()) an unclear error message is returned:

PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is ListResponse and passed type was str at ['received_data']

Expected Behavior

When run on a non-serverless index (which do not support list()) a clear error message that this is an unsupported operation should be displayed.

Steps To Reproduce

Run code using env specified

Code

from pinecone import Pinecone

pc = Pinecone(api_key='34zzzzzzzzzz')
index = pc.Index('self-retriever-pae')

# To iterate over all result pages using a generator function
for ids in index.list( namespace="Non_Varicea"):
    print(ids)

Relevant log output

PineconeApiTypeError                      Traceback (most recent call last)
[<ipython-input-10-ccee60efe570>](https://localhost:8080/#) in <cell line: 8>()
      6 
      7 # To iterate over all result pages using a generator function
----> 8 for ids in index.list( namespace="Non_Variceal_hi_res"):
      9     print(ids)

10 frames
[/usr/local/lib/python3.10/dist-packages/pinecone/core/client/model_utils.py](https://localhost:8080/#) in attempt_convert_item(input_value, valid_classes, path_to_item, configuration, spec_property_naming, key_type, must_convert, check_type)
   1419         if configuration is None or not configuration.discard_unknown_keys:
   1420             raise get_type_error(input_value, path_to_item, valid_classes,
-> 1421                                  key_type=key_type)
   1422     for valid_class in valid_classes_coercible:
   1423         try:

PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is ListResponse and passed type was str at ['received_data']

Environment

- OS:Windows
- Python:3.11
- pinecone: 3.0.03

Additional Context

none

Activity

  1. added
    bug
    on Apr 17, 2024
  2. volksport commented on Apr 17, 2024

    @volksport

    Can confirm this is also an issue for us

  3. shamussim-ai commented on Apr 24, 2024

    @shamussim-ai
    Author

    Hi there, any updates on this? Thank you

  4. daverigby commented on May 3, 2024

    @daverigby
    Contributor

    I attempted to reproduce this on the latest version (v4.0.0) on macOS and don't see the problem anymore.

  5. cbelsole commented on Aug 5, 2024

    @cbelsole

    @daverigby I finally figured out why this was not working. This only works for a serverless index. The error message could probably be clearer.

  6. daverigby commented on Aug 6, 2024

    @daverigby
    Contributor

    @daverigby I finally figured out why this was not working. This only works for a serverless index. The error message could probably be clearer.

    Thanks @cbelsole . I'll re-open and change to cover the fact that the error is not clear for non-server less indexes.

  7. changed the title [-][Bug] index.list to List Vector IDs dont work [/-] [+][Bug] index.list() error message for non-serverless indexes is unclear[/+] on Aug 6, 2024
  8. gildemberg-santos commented on Oct 30, 2024

    @gildemberg-santos

    Additionally, this issue is occurring in version 5.3.1, and I experienced it on Google Cloud Run

    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'
    
  9. brysonwxx commented on Dec 25, 2024

    @brysonwxx

    hi, I also encounter the same error. @daverigby @volksport
    python: 3.8.10
    pinecone-client: 5.0.1
    when I create an Pinecone instance:
    self.pc_cli = Pinecone(api_key=self.api_key, host=self.host, pool_threads=self.POOL_THREADS)

    and call the functions:
    self.pc_cli.describe_index(collection_name), or
    r = self.pc_cli.list_indexes(),

    it raises the error:

    File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/control/pinecone.py", line 541, in describe_index description = api_instance.describe_index(name) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 761, in __call__ return self.callable(self, *args, **kwargs) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/control/api/manage_indexes_api.py", line 632, in __describe_index return self.call_with_http_info(**kwargs) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 819, in call_with_http_info return self.api_client.call_api( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 380, in call_api return self.__call_api( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 208, in __call_api return_data = self.deserialize(response_data, response_type, _check_type) File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/api_client.py", line 301, in deserialize deserialized_data = validate_and_convert_types( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/model_utils.py", line 1441, in validate_and_convert_types converted_instance = attempt_convert_item( File "/home/ubuntu/.pyenv/versions/3.8.10/envs/xxx/lib/python3.8/site-packages/pinecone/core/openapi/shared/model_utils.py", line 1326, in attempt_convert_item raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) pinecone.core.openapi.shared.exceptions.PineconeApiTypeError: Invalid type for variable 'received_data'. Required value type is IndexModel and passed type was str at ['received_data']

    any suggestions for this? thanks!

  10. brysonwxx commented on Dec 26, 2024

    @brysonwxx

    But, when I create the Pinecone instance by
    self.pc_cli = Pinecone(api_key=self.api_key, pool_threads=self.POOL_THREADS), i.e., dont pass the parameter: host=self.host, it's ok.

  11. added
    status:needs-triage
    on Jul 11, 2026
  12. added 2 commits that reference this issue on Sep 22, 2026
    f738a3a
    609bb3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions