Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to connect the backend #568

Open
rubenssoto opened this issue Jan 20, 2025 · 6 comments
Open

Error to connect the backend #568

rubenssoto opened this issue Jan 20, 2025 · 6 comments

Comments

@rubenssoto
Copy link

Hey,

Thank you for this amazing software. I'm trying to deploy in my homelab but I think I did something wrong.

My compose:
`services:
searxng:
image: docker.io/searxng/searxng:latest
volumes:
- /data/apps/perplexica:/etc/searxng:rw
ports:
- 4000
networks:
- container-network
restart: unless-stopped

perplexica-backend:
image: itzcrazykns1337/perplexica-backend:main
environment:
- SEARXNG_API_URL=http://searxng:8080
depends_on:
- searxng
ports:
- 3001:3001
volumes:
- /data/apps/perplexica/backend-dbstore:/home/perplexica/data
- /data/apps/perplexica/uploads:/home/perplexica/uploads
- /data/apps/perplexica/config.toml:/home/perplexica/config.toml
extra_hosts:
- 'host.docker.internal:host-gateway'
networks:
- container-network
restart: unless-stopped

perplexica-frontend:
image: itzcrazykns1337/perplexica-frontend:main
depends_on:
- perplexica-backend
environment:
- NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api
- NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001
ports:
- 3000
networks:
- container-network
restart: unless-stopped

networks:
container-network:
external: true

volumes:
backend-dbstore:
uploads:
`

I'm getting this error on the web frontend: Failed to connect to the server. Please try again later.

@rubenssoto
Copy link
Author

I only found errors on the searchnx container

searxng-1 | During handling of the above exception, another exception occurred:
searxng-1 |
searxng-1 | Traceback (most recent call last):
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
searxng-1 | yield
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 113, in connect_tcp
searxng-1 | with anyio.fail_after(timeout):
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/contextlib.py", line 158, in exit
searxng-1 | self.gen.throw(value)
searxng-1 | File "/usr/lib/python3.12/site-packages/anyio/_core/_tasks.py", line 118, in fail_after
searxng-1 | raise TimeoutError
searxng-1 | TimeoutError
searxng-1 |
searxng-1 | The above exception was the direct cause of the following exception:
searxng-1 |
searxng-1 | Traceback (most recent call last):
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
searxng-1 | yield
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
searxng-1 | resp = await self._pool.handle_async_request(req)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 262, in handle_async_request
searxng-1 | raise exc
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 245, in handle_async_request
searxng-1 | response = await connection.handle_async_request(request)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_async/connection.py", line 92, in handle_async_request
searxng-1 | raise exc
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_async/connection.py", line 69, in handle_async_request
searxng-1 | stream = await self._connect(request)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_async/connection.py", line 117, in _connect
searxng-1 | stream = await self._network_backend.connect_tcp(**kwargs)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 31, in connect_tcp
searxng-1 | return await self._backend.connect_tcp(
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 112, in connect_tcp
searxng-1 | with map_exceptions(exc_map):
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/contextlib.py", line 158, in exit
searxng-1 | self.gen.throw(value)
searxng-1 | File "/usr/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
searxng-1 | raise to_exc(exc) from exc
searxng-1 | httpcore.ConnectTimeout
searxng-1 |
searxng-1 | The above exception was the direct cause of the following exception:
searxng-1 |
searxng-1 | Traceback (most recent call last):
searxng-1 | File "/usr/local/searxng/searx/search/processors/abstract.py", line 73, in initialize
searxng-1 | self.engine.init(get_engine_from_settings(self.engine_name))
searxng-1 | File "/usr/local/searxng/searx/engines/soundcloud.py", line 69, in init
searxng-1 | guest_client_id = get_client_id()
searxng-1 | ^^^^^^^^^^^^^^^
searxng-1 | File "/usr/local/searxng/searx/engines/soundcloud.py", line 45, in get_client_id
searxng-1 | resp = http_get("https://soundcloud.com")
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/local/searxng/searx/network/init.py", line 164, in get
searxng-1 | return request('get', url, **kwargs)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/local/searxng/searx/network/init.py", line 95, in request
searxng-1 | return future.result(timeout)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/concurrent/futures/_base.py", line 456, in result
searxng-1 | return self.__get_result()
searxng-1 | ^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
searxng-1 | raise self._exception
searxng-1 | File "/usr/local/searxng/searx/network/network.py", line 291, in request
searxng-1 | return await self.call_client(False, method, url, **kwargs)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/local/searxng/searx/network/network.py", line 287, in call_client
searxng-1 | raise e
searxng-1 | File "/usr/local/searxng/searx/network/network.py", line 272, in call_client
searxng-1 | response = await client.request(method, url, **kwargs)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_client.py", line 1530, in request
searxng-1 | return await self.send(request, auth=auth, follow_redirects=follow_redirects)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_client.py", line 1617, in send
searxng-1 | response = await self._send_handling_auth(
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
searxng-1 | response = await self._send_handling_redirects(
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
searxng-1 | response = await self._send_single_request(request)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_client.py", line 1719, in _send_single_request
searxng-1 | response = await transport.handle_async_request(request)
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
searxng-1 | with map_httpcore_exceptions():
searxng-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
searxng-1 | File "/usr/lib/python3.12/contextlib.py", line 158, in exit
searxng-1 | self.gen.throw(value)
searxng-1 | File "/usr/lib/python3.12/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
searxng-1 | raise mapped_exc(message) from exc
searxng-1 | httpx.ConnectTimeout

@HoustonMuzamhindo
Copy link

Isn’t this because of SSL errors on your Searxng? I have firewall errors on my work laptop so I am testing this on my personal one.

@rubenssoto
Copy link
Author

I think the problem is on the frontend...I got some error:

Image

I don't know where this 127.0.0.1 is comming from

@Mkz9s4Vy
Copy link

because this project hard-code 127.0.0.1 in its frontend, you should follow this closed issue.
#92

@realies
Copy link
Contributor

realies commented Jan 21, 2025

#92 does not help if you're using the Docker published images. One way of doing it is: #467 (comment)

There are other ways in the countless issues about it.

@keven1024
Copy link

You can use this docker #565, I have solved the problem of variable hardcoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants