EDIT: Issue is found, they are working on a solution. https://status.pinecone.io/
Adding my name to the pile. I am following the Quickstart guide but am still unable to upsert to the index.
Code
import pinecone
def create_pinecone_index(index_name: str, dimensions: int, metric: str, pod_type: str) -> object:
if index_name in pinecone.list_indexes():
return
# pinecone.delete_index(index_name)
pinecone.create_index(name=index_name, dimension=dimensions, metric=metric, pod_type=pod_type)
def connect_to_quickstart(index_name: str,):
"""Main function"""
if index_name not in pinecone.list_indexes():
print("Index not found")
return
index = pinecone.Index(index_name)
print(pinecone.whoami())
print(pinecone.describe_index(index_name))
index.upsert([
("A", [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]),
("B", [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]),
("C", [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]),
("D", [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]),
("E", [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5])
])
if __name__ == '__main__':
pinecone.init(api_key="API_KEY",
environment="asia-northeast1-gcp",
project_name="PROJECT_NAME")
create_pinecone_index("quickstart", dimensions=8, metric="euclidean", pod_type="p1")
connect_to_quickstart("quickstart")
Error:
WhoAmIResponse(username=‘USER_NAME’, user_label=‘default’, projectname=‘PROJECT_NAME’)
IndexDescription(name=‘quickstart’, metric=‘euclidean’, replicas=1, dimension=8.0, shards=1, pods=1, pod_type=‘p1.x1’, status={‘ready’: True, ‘state’: ‘Ready’}, metadata_config=None, source_collection=‘’)
Traceback (most recent call last):
File “D:\Python_Projects\py-pkm\venv\connection_to_quickstart.py”, line 36, in
connect_to_quickstart(“quickstart”)
File “D:\Python_Projects\py-pkm\venv\connection_to_quickstart.py”, line 21, in connect_to_quickstart
index.upsert([
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\utils\error_handling.py”, line 17, in inner_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\index.py”, line 147, in upsert
return self._upsert_batch(vectors, namespace, _check_type, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\index.py”, line 231, in _upsert_batch
return self._vector_api.upsert(
^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 776, in call
return self.callable(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api\vector_operations_api.py”, line 956, in __upsert
return self.call_with_http_info(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 838, in call_with_http_info
return self.api_client.call_api(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 413, in call_api
return self.__call_api(resource_path, method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 207, in __call_api
raise e
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 200, in __call_api
response_data = self.request(
^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\api_client.py”, line 459, in request
return self.rest_client.POST(url,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\rest.py”, line 271, in POST
return self.request(“POST”, url,
^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Projects\py-pkm\venv\Lib\site-packages\pinecone\core\client\rest.py”, line 222, in request
raise ForbiddenException(http_resp=r)
pinecone.core.client.exceptions.ForbiddenException: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({‘content-length’: ‘0’, ‘date’: ‘Mon, 24 Apr 2023 21:10:09 GMT’, ‘server’: ‘envoy’})