openai.APIConnectionError: Connection error. #1435
Unanswered
kongaraman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Receiving below error when i ran python examples/lightrag_azure_openai_demo.py. Same code worked last week but got this error from last 2 days. Just checking if someone has same issue and have any solution/fix for this
Result (Hybrid):
INFO:openai._base_client:Retrying request to /embeddings in 0.454897 seconds
INFO:openai._base_client:Retrying request to /embeddings in 0.830951 seconds
Traceback (most recent call last):
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_transports\default.py", line 101, in map_httpcore_exceptions
yield
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_transports\default.py", line 250, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\connection_pool.py", line 256, in handle_request
raise exc from None
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\connection_pool.py", line 236, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\connection.py", line 103, in handle_request
return self._connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\http11.py", line 136, in handle_request
raise exc
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\http11.py", line 106, in handle_request
) = self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\http11.py", line 177, in _receive_response_headers
event = self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpcore_sync\http11.py", line 231, in _receive_event
raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 955, in _request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_client.py", line 1014, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_transports\default.py", line 249, in handle_request
with map_httpcore_exceptions():
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 158, in exit
self.gen.throw(value)
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\httpx_transports\default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\GitRepo\LightRAG_old\examples\lightrag_azure_openai_demo.py", line 153, in
main()
File "C:\Users\GitRepo\LightRAG_old\examples\lightrag_azure_openai_demo.py", line 144, in main
print(rag.query(query_text, param=QueryParam(mode="hybrid")))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\lightrag.py", line 1330, in query
return loop.run_until_complete(self.aquery(query, param, system_prompt)) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\lightrag.py", line 1354, in aquery
response = await kg_query(
^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\operate.py", line 861, in kg_query
context = await _build_query_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\operate.py", line 1311, in _build_query_context
ll_data = await _get_node_data(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\operate.py", line 1381, in _get_node_data
results = await entities_vdb.query(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\kg\nano_vector_db_impl.py", line 128, in query
embedding = await self.embedding_func([query])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\utils.py", line 279, in wait_func
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG\lightrag\utils.py", line 202, in call
return await self.func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\examples\lightrag_azure_openai_demo.py", line 70, in embedding_func
embedding = client.embeddings.create(model=AZURE_EMBEDDING_DEPLOYMENT, input=texts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai\resources\embeddings.py", line 128, in create
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 979, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 1057, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 979, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 1057, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\GitRepo\LightRAG_old\myenv\Lib\site-packages\openai_base_client.py", line 989, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
(myenv) PS C:\Users\GitRepo\LightRAG_old>
Beta Was this translation helpful? Give feedback.
All reactions