Hi All,
This might be a familiar issue (httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)) - which I am getting while uploading embeddings in pinecone vector database.
I tried to implement all possible options suggested in the forum like :a. Ensure environment has the necessary CA certificates, b. Proxy not available , c. Even Disabling SSL Verification , nothing is working out, pls note code was working a week back .Here I am using windows OS, Python version : 3.12 , upgraded crtifi package too . Just to mention using python code, I am able to create Index in Pinecone DB, but while uploading embedding , it is giving this issue .Could you pls. help me here , a little urgent. Thanks in advance.
Hi @nandini914, and welcome to the Pinecone community forums!
Thanks for your question, and I’m sorry to hear you’re running into this issue.
Could you please share all of your relevant code, being careful not to include any secrets such as your API keys?
That will help us debug what might be going wrong more effectively - as it’s difficult to work backwards from your description without seeing the code.
Looking forward to your response.
Best,
Zack
Here is the code -
from pinecone import Pinecone
from langchain_openai import OpenAIEmbeddings
from langchain_pinecone import PineconeVectorStore
import urllib3
import os
os.environ[‘OPENAI_API_KEY’] = ‘XXXXXXXXX’
os.environ[‘PINECONE_API_KEY’] = ‘YYYYYYYY’
pc = Pinecone(
api_key=“YYYY”,
proxy_url=None,
proxy_headers=urllib3.make_headers(proxy_basic_auth=‘username:password’),
ssl_ca_certs=“C:\Users\nraynag\PycharmProjects\pythonProject\.venv\Lib\site-packages\certifi\cacert.pem”,
ssl_verify=False
)
Creating Index
index_name = “my-index2”
if index_name not in pc.list_indexes().names():
pc.create_index(
name=‘my-index2’,
dimension=1536,
metric=‘cosine’,
spec=ServerlessSpec(
cloud=‘aws’,
region=‘us-east-1’
)
)
Instantiate the index for Pinecone
index = pc.Index(“my-index2”)
#Capturing Index Name of Pinecone
index_name = “my-index2”
Initialize the OpenAI embeddings model
model_name = ‘text-embedding-ada-002’
embeddings = OpenAIEmbeddings(model=model_name, openai_api_key=os.environ[‘OPENAI_API_KEY’])
Example text data
texts = [“Sample text 1”, “Sample text 2”]
Create and upload embeddings to Pinecone
vectorstore = PineconeVectorStore(index_name=index_name, embedding=embeddings)
vectorstore = PineconeVectorStore.from_texts(texts, embeddings, index_name=index_name)
Did you ever resolve this issue?