-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Which version of Nextcloud are you using?
32.0.3
Which version of PHP context_chat are you using?
5.2.0
Which version of backend context_chat are you using?
5.2.0
Nextcloud deployment method?
apache non-docker
Describe the Bug
When a request is made it throws an error. It still works but can fill the logs.
Something to note is that llm container has this log every few seconds:
2026-01-14 08:00:47,650 - urllib3.connectionpool - WARNING - Retrying (Retry(total=0, connect=None, read=False, redirect=None, status=None)) after connection broken by 'MustRedialError('Remote peer just closed our connection, probably for not answering to unsolicited packet. (None)')': /ocs/v2.php/taskprocessing/tasks_provider/next?format=json
and stablediffusion2 container gives this:
2026-01-14 08:04:47,645 - main - ERROR - Remote end closed connection without response
So maybe it is all related?
P.S. Sorry for not giving better logs. I am not sure what is helpful, what is sensitive information, and what would just get in the way of what you need.
To Reproduce
Make a request to do an ask context chat, it seems to work with the search so just the "context chat" in Assistant.
PHP logs (Warning these might contain sensitive information)
No response
Ex-App logs (Warning these might contain sensitive information)
INFO: 127.0.0.1:50530 - "POST /v1/embeddings HTTP/1.1" 200 OK
2026-01-14T07:41:16+0000: [WARNING|nc_texttotext]: Ignored error during task polling
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py", line 250, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
raise exc from None
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection.py", line 103, in handle_request
return self._connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py", line 136, in handle_request
raise exc
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py", line 106, in handle_request
) = self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py", line 177, in _receive_response_headers
event = self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-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 "/app/context_chat_backend/models/nc_texttotext.py", line 117, in _call
response = nc.ocs('GET', f'/ocs/v1.php/taskprocessing/task/{task.id}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/nc_py_api/nextcloud.py", line 144, in ocs
return self._session.ocs(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/nc_py_api/_session.py", line 209, in ocs
response = self.adapter.request(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_client.py", line 825, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_client.py", line 1014, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py", line 249, in handle_request
with map_httpcore_exceptions():
File "/usr/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.11/dist-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.
INFO: - "POST /query HTTP/1.1" 200 OK
Server logs (if applicable)
[context_agent] Warning: Error fetching the next task Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 225, in _new_conn
sock = self._resolver.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/contrib/resolver/protocols.py", line 218, in create_connection
records = self.getaddrinfo(
^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/contrib/resolver/protocols.py", line 458, in getaddrinfo
raise socket.gaierror(
socket.gaierror: Name or service not known: using 1 resolver(s)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1713, in urlopen
response = self._make_request( # type: ignore[call-overload,misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1257, in _make_request
raise new_e
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1233, in _make_request
self._validate_conn(conn)
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 2296, in _validate_conn
super()._validate_conn(conn)
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 788, in _validate_conn
conn.connect()
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 776, in connect
self.sock = sock = self._new_conn()
^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 238, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7fff20693050>: Failed to resolve '' (Name or service not known: using 1 resolver(s))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/niquests/adapters.py", line 882, in send
resp_or_promise = conn.urlopen( # type: ignore[call-overload,misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1844, in urlopen
return self.urlopen( # type: ignore[no-any-return,call-overload,misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1791, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/urllib3/util/retry.py", line 544, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /ocs/v2.php/taskprocessing/tasks_provider/next?format=json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fff20693050>: Failed to resolve '' (Name or service not known: using 1 resolver(s))"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/ex_app/lib/main.py", line 145, in background_thread_task
response = nc.providers.task_processing.next_task([provider.id], [provider.task_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/nc_py_api/ex_app/providers/task_processing.py", line 137, in next_task
if r := self._session.ocs(
^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/nc_py_api/_session.py", line 218, in ocs
response = self.adapter.request(method, path, data=content, json=json, params=params, files=files, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/niquests/sessions.py", line 582, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/niquests/sessions.py", line 1281, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pypoetry/virtualenvs/context-agent-il7asoJj-py3.11/lib/python3.11/site-packages/niquests/adapters.py", line 934, in send
raise ConnectionError(e, request=request)
niquests.exceptions.ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /ocs/v2.php/taskprocessing/tasks_provider/next?format=json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7fff20693050>: Failed to resolve '' (Name or service not known: using 1 resolver(s))"))
POST /ocs/v1.php/apps/app_api/api/v1/log?format=json
from <My IP> by -- at Jan 14, 2026, 2:49:14 AM
This was just one I thought might be relevant.