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 · 17 comments
Open

Error to connect the backend #568

rubenssoto opened this issue Jan 20, 2025 · 17 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

@rubenssoto
Copy link
Author

Hey Guys, I was able to fix the error, now I'm pointing to the container name.

Image

Do you know how to solve this

@rubenssoto
Copy link
Author

Hey @keven1024 @realies @Mkz9s4Vy do you know what it is

thank you

@realies
Copy link
Contributor

realies commented Jan 25, 2025

look up the issues, it's a problem the author does not want to address

@ItzCrazyKns
Copy link
Owner

look up the issues, it's a problem the author does not want to address

None on the projects including Open WebUI provide support for errors related to networking, I've added a really good guide explaining the entire process, please read it correctly and try again

@rubenssoto
Copy link
Author

hey @ItzCrazyKns , could you help me with the error please, the problem with the 127.0.0.1 was solved now the error is little different.
Man, I dont want to be in this fight, i just wanna use this amazing project, I stopped to pay perplexity pro to use perplexica.

@ItzCrazyKns
Copy link
Owner

Follow this guide, if you face any issues, I am here to help: https://github.com/ItzCrazyKns/Perplexica/blob/master/docs/installation/NETWORKING.md

@rubenssoto
Copy link
Author

@ItzCrazyKns Now it is working, I needed to configure an endpoint with nginx to the backend as well. Thank you for your help.

But when I try to do a search nothing happens

Image

I was trying to find some errors

Backend

perplexica-backend-1  | yarn run v1.22.22
perplexica-backend-1  | $ npm run db:push && node dist/app.js
perplexica-backend-1  | 
perplexica-backend-1  | > [email protected] db:push
perplexica-backend-1  | > drizzle-kit push sqlite
perplexica-backend-1  | 
perplexica-backend-1  | drizzle-kit: v0.22.7
perplexica-backend-1  | drizzle-orm: v0.31.2
perplexica-backend-1  | 
perplexica-backend-1  | No config path provided, using default path
perplexica-backend-1  | Reading config file '/home/perplexica/drizzle.config.ts'
perplexica-backend-1  | [⣷] Pulling schema from database...
perplexica-backend-1  | G[✓] Pulling schema from database...
perplexica-backend-1  | 
perplexica-backend-1  | [i] No changes detected
perplexica-backend-1  | info: WebSocket server started on port 3001
perplexica-backend-1  | info: Server is running on port 3001
perplexica-backend-1  | error: Unhandled Rejection at: [object Promise], reason: AxiosError: Request failed with status code 403

front end

perplexica-frontend-1  | yarn run v1.22.22
perplexica-frontend-1  | $ next start
perplexica-frontend-1  |    ▲ Next.js 14.1.4
perplexica-frontend-1  |    - Local:        http://localhost:3000
perplexica-frontend-1  | 
perplexica-frontend-1  |  ✓ Ready in 352ms
perplexica-frontend-1  | yarn run v1.22.22
perplexica-frontend-1  | $ next start
perplexica-frontend-1  |    ▲ Next.js 14.1.4
perplexica-frontend-1  |    - Local:        http://localhost:3000
perplexica-frontend-1  | 
perplexica-frontend-1  |  ✓ Ready in 1400ms

searxng

searxng-1  | *** Operational MODE: preforking+threaded ***
searxng-1  | added /usr/local/searxng/ to pythonpath.
searxng-1  | spawned uWSGI master process (pid: 6)
searxng-1  | spawned uWSGI worker 1 (pid: 12, cores: 4)
searxng-1  | spawned 4 offload threads for uWSGI worker 1
searxng-1  | spawned uWSGI worker 2 (pid: 17, cores: 4)
searxng-1  | spawned 4 offload threads for uWSGI worker 2
searxng-1  | spawned uWSGI worker 3 (pid: 22, cores: 4)
searxng-1  | spawned uWSGI worker 4 (pid: 26, cores: 4)
searxng-1  | spawned 4 offload threads for uWSGI worker 3
searxng-1  | spawned uWSGI worker 5 (pid: 28, cores: 4)
searxng-1  | spawned uWSGI worker 6 (pid: 32, cores: 4)
searxng-1  | spawned 4 offload threads for uWSGI worker 5
searxng-1  | spawned uWSGI worker 7 (pid: 35, cores: 4)
searxng-1  | spawned uWSGI worker 8 (pid: 38, cores: 4)
searxng-1  | spawned 4 offload threads for uWSGI worker 6
searxng-1  | spawned 4 offload threads for uWSGI worker 4
searxng-1  | spawned 4 offload threads for uWSGI worker 7
searxng-1  | spawned 4 offload threads for uWSGI worker 8
searxng-1  | 2025-01-28 16:17:21,315 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,315 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,316 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,318 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,319 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,321 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,323 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,341 WARNING:searx.engines: Engine name is not lowercase: "Public Domain Image Archive", converting to lowercase
searxng-1  | 2025-01-28 16:17:21,436 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | 2025-01-28 16:17:21,440 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | 2025-01-28 16:17:21,441 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 26 (default app)
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 32 (default app)
searxng-1  | 2025-01-28 16:17:21,446 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 28 (default app)
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 38 (default app)
searxng-1  | 2025-01-28 16:17:21,450 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | 2025-01-28 16:17:21,455 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | 2025-01-28 16:17:21,457 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 22 (default app)
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 35 (default app)
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 12 (default app)
searxng-1  | 2025-01-28 16:17:21,470 WARNING:searx.botdetection.config: missing config file: /etc/searxng/limiter.toml
searxng-1  | WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7565bcd8cc30 pid: 17 (default app)

@ItzCrazyKns
Copy link
Owner

How did you set up the SearXNG? Use the config and limiter files I provide the error should be gone, most probably an error with JSON mode disabled in SearXNG

@rubenssoto
Copy link
Author

@ItzCrazyKns I'm using the docker compose available, do I need to setup Searxng?

@ItzCrazyKns
Copy link
Owner

@ItzCrazyKns I'm using the docker compose available, do I need to setup Searxng?

Its either an issue related to SearXNG or the LLM you're using

@doggi87
Copy link

doggi87 commented Jan 30, 2025

I had issues also but got everything to work.
Try to fix the missing config first in searxng by creating a limiter.toml (/etc/searxng/limiter.toml) https://docs.searxng.org/admin/searx.limiter.html

And you compose for searxng seems different:

Try this:

searxng:
image: searxng/searxng:latest
ports:
- 4000:8080

yours is: ports:
- 4000

And in ports for frontend in yours is:
ports:

  • 3000

should be
ports:
- 3000:3000

Change this in yours maby this helps or you found the issue?

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

7 participants