python 当尝试在pinecone DB中注入LlamaIndex数据时,我收到Max retries exceeded(_ssl.c:2427)错误

pgvzfuti  于 12个月前  发布在  Python
关注(0)|答案(1)|浏览(109)

我得到一个最大重试超过了URL:

(Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))

字符串
当尝试在pinecone DB中注入数据时当尝试使用LlamaIndex将数据注入到Pinecone DB中时,我得到以下错误:

LlamaIndex_Doc_Helper-JJYEcwwZ\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
        raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='llamaindex-documentation-helper-ksad0bm.svc.gcp-starter.pinecone.io', port=443): Max retries exceeded with url: /vectors/upsert (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))
    Upserted vectors:   0%|          | 0/18 [00:02<?, ?it/s]


我的Python代码:

#--- Indexing in Pinecone
    # Init. Pinecone Index object
    index_name = "llamaindex-documentation-helper"
    pinecone_index = pinecone.Index(index_name=index_name)
    # Init. vector store object
    vector_store = PineconeVectorStore(pinecone_index=pinecone_index)
    # Init storage context
    storage_context = StorageContext.from_defaults(vector_store=vector_store)
    # Creates
    index = VectorStoreIndex.from_documents(
        documents=documents, # documents = dir_reader.load_data()
        storage_context=storage_context, # storage_context = StorageContext.from_defaults(vector_store=vector_store)
        service_context=service_context, # service_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model, node_parser=node_parser)
        show_progress=True,
    )


我禁用了防火墙、VPN和防病毒程序我在pipenv中使用Windows 11专业版、Python版本3.12,我的pip安装证书--升级是最新的
我也可以ping服务器:

LlamaIndex Tutorial\LlamaIndex Doc Helper> ping llamaindex-documentation-helper-ksad0bm.svc.gcp-starter.pinecone.io

Pinging ingress.gcp-starter.pinecone.io [34.160.88.44] with 32 bytes of data:
Reply from 34.160.88.44: bytes=32 time=10ms TTL=114
Reply from 34.160.88.44: bytes=32 time=9ms TTL=114
Reply from 34.160.88.44: bytes=32 time=11ms TTL=114
Reply from 34.160.88.44: bytes=32 time=9ms TTL=114

Ping statistics for 34.160.88.44:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 9ms, Maximum = 11ms, Average = 9ms


任何关于如何解决这个问题的意见将不胜感激

mo49yndu

mo49yndu1#

我找到了问题的来源并解决了它。下面的代码行是错误的来源:

index_name = "llamaindex-documentation-helper"

字符串
索引的名称与我的Picone帐户上的索引名称不完全匹配.错别字是怪物。
我下面的代码行提供了一种检查索引名称是否存在并清除/重置Pinecone数据库的方法

index_name = "llamaindex-oc-helper"
# Checks if the picone DB exists
if index_name not in pinecone.list_indexes():
    print("\n\033[96m The index name is not in the list of indexes associated with the provided Pinecone account.\n")
    # Hard exit
    exit()
# Init. Pinecone Index object
pinecone_index = pinecone.Index(index_name=index_name)
# Warning! Wipes the pinecone DB
pinecone_index.delete(delete_all=True)

相关问题