rashadphz/farfalle

Throws 500: All connection attempts. File ./workspace/src/backend/chat.py

just-a-pancil opened this issue · 0 comments

image

Please help, I tried read issues and fix errors with existing recommendations, I also tried to google. I suppose I have lack of knowladge or lack of understanding.

I use llama3:latest
Ollama is running at http://127.0.0.1:11434/

This is log

sudo docker attach 5da5e2f8bfc4

INFO: 172.18.0.1:53226 - "OPTIONS /chat HTTP/1.1" 200 OK
INFO: 172.18.0.1:53226 - "POST /chat HTTP/1.1" 200 OK
Traceback (most recent call last):
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
raise exc from None
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
raise exc
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 122, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 114, in connect_tcp
with map_exceptions(exc_map):
File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)
File "/workspace/.venv/lib/python3.11/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: All connection attempts failed

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

Traceback (most recent call last):
File "/workspace/src/backend/chat.py", line 111, in stream_qa_objects
async for completion in response_gen:
File "/workspace/.venv/lib/python3.11/site-packages/llama_index/core/llms/callbacks.py", line 280, in wrapped_gen
async for x in f_return_val:
File "/workspace/.venv/lib/python3.11/site-packages/llama_index/llms/ollama/base.py", line 401, in gen
async with client.stream(
File "/usr/local/lib/python3.11/contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1617, in stream
response = await self.send(
^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1661, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1763, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 372, in handle_async_request
with map_httpcore_exceptions():
File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)
File "/workspace/.venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: All connection attempts failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/workspace/src/backend/main.py", line 97, in generator
async for obj in stream_qa_objects(chat_request):
File "/workspace/src/backend/chat.py", line 140, in stream_qa_objects
raise HTTPException(status_code=500, detail=detail)
fastapi.exceptions.HTTPException: 500: All connection attempts failed

sudo docker compose -f docker-compose.dev.yaml up -d

WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "GROQ_API_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "REDIS_URL" variable is not set. Defaulting to a blank string.
[+] Running 3/3
✔ Container searxng Running 0.0s
✔ Container farfalle-main-backend-1 Started 2.4s
✔ Container farfalle-main-frontend-1 Started 1.3s

sudo docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
48bc069e5349 farfalle-main-frontend "docker-entrypoint.s…" 12 minutes ago Up 12 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp farfalle-main-frontend-1
5da5e2f8bfc4 farfalle-main-backend "uvicorn backend.mai…" 12 minutes ago Up 12 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp farfalle-main-backend-1
80d014fd8ea4 searxng/searxng:latest "/sbin/tini -- /usr/…" 12 minutes ago Up 12 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp searxng

journalctl -u ollama

Jun 06 16:42:37 hentii ollama[2959]: [GIN] 2024/06/06 - 16:42:37 | 200 | 41.305369ms | 127.0.0.1 | GET >
Jun 06 17:16:04 hentii ollama[2959]: [GIN] 2024/06/06 - 17:16:04 | 200 | 30.445µs | 127.0.0.1 | GET >
Jun 06 17:16:04 hentii ollama[2959]: [GIN] 2024/06/06 - 17:16:04 | 404 | 8.224µs | 127.0.0.1 | GET >
Jun 06 17:58:41 hentii ollama[2959]: [GIN] 2024/06/06 - 17:58:41 | 200 | 77.015µs | 127.0.0.1 | HEAD >
Jun 06 17:58:41 hentii ollama[2959]: [GIN] 2024/06/06 - 17:58:41 | 200 | 6.530742ms | 127.0.0.1 | GET >

sudo docker attach 80d014fd8ea4

2024-06-06 15:38:48,618 WARNING:searx.engines.openverse: ErrorContext('searx/search/processors/online.py', 125, 'count_error(', None, '1 redirects, maximum: 0', ('200', 'OK', 'api.openverse.org')) True
2024-06-06 15:38:49,105 WARNING:searx.engines.qwant images: ErrorContext('searx/engines/qwant.py', 226, "title = item.get('title', None)", 'AttributeError', None, ()) False
2024-06-06 15:38:49,105 ERROR:searx.engines.qwant images: exception : 'str' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/local/searxng/searx/search/processors/online.py", line 163, in search
search_results = self._search_basic(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/searxng/searx/search/processors/online.py", line 151, in _search_basic
return self.engine.response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/searxng/searx/engines/qwant.py", line 151, in response
return parse_web_api(resp)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/searxng/searx/engines/qwant.py", line 226, in parse_web_api
title = item.get('title', None)
^^^^^^^^
AttributeError: 'str' object has no attribute 'get'