I get this error : Failed to connect; did you specify the correct index name? while doing index.upsert().
I am on Standard Plan.
my code:
import pinecone
index_name = os.getenv("INDEX_NAME")
pinecone.init(project_name=project_name, api_key=api_key, environment=environment)
log.info(f' Pinecone indexs####: {pinecone.list_indexes()}'). ## Logs index name correctly
index = pinecone.Index(index_name=index_name). # index_name is correctly here
pinecone_index_documents = [('id1',embedding, metadata),...] # This format is correct, wroked on free tier plan
index.upsert(pinecone_index_documents) # gets error here : Failed to connect; did you specify the correct index name?**
No Idea what’s going on. I ma running it in Azure python function app…
If the error persists, follow the exact code from here: Python Client (upserting) I think the code from the documentation should be good. I never used the project_name parameter when init-ing my indexes (documentation: Python Client (init) does not specify it as well) so try removing that from the code as well and see if it works.
And if that won’t work for you use the Standard support to open a ticket and the Pinecone support team will help you out.
I am on standard plan and created a new project and not using default project.
So here we do need to set project_name:
pinecone.init(project_name=project_name, api_key=api_key, environment=environment)
Issue was I was setting project_name argument value as the project’s name, but it actually needs project’s id to build the endpoint correctly, i.e.: “9e5ac96” below. Looks like documentation need to clarify it somehwere.