http 104 error #91

Open
opened 2026-02-15 16:27:57 -05:00 by yindo · 3 comments
Owner

Originally created by @zwshan on GitHub (Jun 3, 2024).

(ragenv) [root@1477dc078bac local-LLM-with-RAG]# python
Python 3.9.19 (main, May  6 2024, 19:43:03) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ollama
>>> response = ollama.chat(model='llama3', messages=[
...   {
...     'role': 'user',
...     'content': 'Why is the sky blue?',
...   },
... ])

Traceback (most recent call last):
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 113, in iter
for part in self._httpcore_stream:
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 367, in iter
raise exc from None
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 363, in iter
for part in self._stream:
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 349, in iter
raise exc
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 341, in iter
for chunk in self._connection._receive_response_body(**kwargs):
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 210, in _receive_response_body
event = self._receive_event(timeout=timeout)
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 224, in _receive_event
data = self._network_stream.read(
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read
return self._sock.recv(max_bytes)
File "/root/anaconda3/envs/ragenv/lib/python3.9/contextlib.py", line 137, in exit
self.gen.throw(typ, value, traceback)
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadError: [Errno 104] Connection reset by peer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 1, in
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 177, in chat
return self._request_stream(
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 97, in _request_stream
return self._stream(*args, **kwargs) if stream else self._request(*args, **kwargs).json()
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 68, in _request
response = self._client.request(method, url, **kwargs)
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 827, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 928, in send
raise exc
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 922, in send
response.read()
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 813, in read
self._content = b"".join(self.iter_bytes())
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 829, in iter_bytes
for raw_bytes in self.iter_raw():
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 883, in iter_raw
for raw_stream_bytes in self.stream:
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 126, in iter
for chunk in self._stream:
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 114, in iter
yield part
File "/root/anaconda3/envs/ragenv/lib/python3.9/contextlib.py", line 137, in exit
self.gen.throw(typ, value, traceback)
File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadError: [Errno 104] Connection reset by peer

Originally created by @zwshan on GitHub (Jun 3, 2024). ```bash (ragenv) [root@1477dc078bac local-LLM-with-RAG]# python Python 3.9.19 (main, May 6 2024, 19:43:03) [GCC 11.2.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ollama >>> response = ollama.chat(model='llama3', messages=[ ... { ... 'role': 'user', ... 'content': 'Why is the sky blue?', ... }, ... ]) ``` Traceback (most recent call last): File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions yield File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 113, in __iter__ for part in self._httpcore_stream: File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 367, in __iter__ raise exc from None File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 363, in __iter__ for part in self._stream: File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 349, in __iter__ raise exc File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 341, in __iter__ for chunk in self._connection._receive_response_body(**kwargs): File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 210, in _receive_response_body event = self._receive_event(timeout=timeout) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 224, in _receive_event data = self._network_stream.read( File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read return self._sock.recv(max_bytes) File "/root/anaconda3/envs/ragenv/lib/python3.9/contextlib.py", line 137, in __exit__ self.gen.throw(typ, value, traceback) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ReadError: [Errno 104] Connection reset by peer The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 177, in chat return self._request_stream( File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 97, in _request_stream return self._stream(*args, **kwargs) if stream else self._request(*args, **kwargs).json() File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/ollama/_client.py", line 68, in _request response = self._client.request(method, url, **kwargs) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 827, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 928, in send raise exc File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 922, in send response.read() File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 813, in read self._content = b"".join(self.iter_bytes()) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 829, in iter_bytes for raw_bytes in self.iter_raw(): File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_models.py", line 883, in iter_raw for raw_stream_bytes in self.stream: File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_client.py", line 126, in __iter__ for chunk in self._stream: File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 114, in __iter__ yield part File "/root/anaconda3/envs/ragenv/lib/python3.9/contextlib.py", line 137, in __exit__ self.gen.throw(typ, value, traceback) File "/root/anaconda3/envs/ragenv/lib/python3.9/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ReadError: [Errno 104] Connection reset by peer
Author
Owner

@zwshan commented on GitHub (Jun 3, 2024):

but the ollama GO language version runs ok on my machine

@zwshan commented on GitHub (Jun 3, 2024): but the ollama GO language version runs ok on my machine
Author
Owner

@zyrdegit commented on GitHub (Oct 31, 2024):

the same as yours,how can solve this?

@zyrdegit commented on GitHub (Oct 31, 2024): the same as yours,how can solve this?
Author
Owner

@xuzexin-hz commented on GitHub (Mar 5, 2025):

Image

The most effective way is to debug

@xuzexin-hz commented on GitHub (Mar 5, 2025): ![Image](https://github.com/user-attachments/assets/824b585d-5044-490e-90e2-8633b924aa57) The most effective way is to debug
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#91