Anyone runs into the same error as me do?if INDEX_NAME in [index.name for index in pinecone.list_indexes()] get an error 'NoneType' object is not iterable
`
pinecone = Pinecone(api_key=PINECONE_API_KEY)
INDEX_NAME = utils.create_dlai_index_name('dl-ai')
if INDEX_NAME in [index.name for index in pinecone.list_indexes()]:
pinecone.delete_index(INDEX_NAME)
print(INDEX_NAME)
pinecone.create_index(name=INDEX_NAME,
dimension=model.get_sentence_embedding_dimension(),
metric='cosine',
spec=ServerlessSpec(cloud='aws', region='us-west-2'))
index = pinecone.Index(INDEX_NAME)
print(index)
I have run into the same error.
While trying to trace down the source, I tried checking why, I reached the following coinclusion:
print(PINECONE KEY) → this prints some value.
I have a personal pinecone key, this does NOT look like that.
The next step - see why the None came:
print(pinecone.list_indexes())
This has the following response:
{‘error’: 'Access control denied: Principal missing permission: ’
‘control::index::list’}
Does this basically mean an expired or a revoked key?
Hi guys I got the same issue still can not fix it.
TypeError Traceback (most recent call last)
Cell In[10], line 4
1 pinecone = Pinecone(api_key=PINECONE_API_KEY)
2 INDEX_NAME = utils.create_dlai_index_name(‘dl-ai’)
----> 4 if INDEX_NAME in [index.name for index in pinecone.list_indexes()]:
5 pinecone.delete_index(INDEX_NAME)
6 print(INDEX_NAME)