Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

docsearch = Pinecone.from_documents(docs, embeddings, index_name=index_name) returns Failed to establish a new connection: [Errno 11001] getaddrinfo failed') #45

Open
sirio2013 opened this issue May 28, 2023 · 1 comment

Comments

@sirio2013
Copy link

sirio2013 commented May 28, 2023

Hello,

I have this code that is not working, even if I used the one in the documentation (https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/pinecone.html)

from langchain.document_loaders import TextLoader
loader = TextLoader('cleaned_catalogue.txt')
documents = loader.load()

from langchain.text_splitter import CharacterTextSplitter
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
docs = text_splitter.split_documents(documents)

pinecone.init(
api_key='my_secret_api_key', # find at app.pinecone.io
environment='my_secret_env_key' # next to api key in console
)
index_name = "ai-assistant-qa-products" # put in the name of your pinecone index here

from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(openai_api_key='my_secret_api_key')

from langchain.vectorstores import Pinecone
docsearch = Pinecone.from_documents(docs, embeddings, index_name=index_name)

I receive a series of error:
MaxRetryError: HTTPSConnectionPool(host='controller.223199e7-5017-4014-a9fc-3d141c00b38d.pinecone.io', port=443): Max retries exceeded with url: /databases (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002B559524F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

@iPanchalShubham
Copy link

I finally Found it after days of search and struggle, it's actually a problem related to our local DNS configuration. Just change your local WIFI network DNS Configuration to Google's DNS servers:
Preferred DNS server: 8.8.8.8
Alternate DNS server: 8.8.4.4

let me know if anyone needs more help with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants