Perplexica icon indicating copy to clipboard operation
Perplexica copied to clipboard

project is broken on linux

Open mlario opened this issue 1 year ago • 8 comments

Describe the bug Several last updates made perplexica unusable on linux. I only get "Failed to connect to server. Please try again later" after doing search

With earlier version it was running though. Backend log is in attachments backend_log.txt

To Reproduce I run perplexica as docker on local vanilla Fedora linux. My ollama is run as systemd service. Searxng is run from a separate docker on port 4000, config of searxng includes json option

A month ago I had to do several modifications to make perplexica work even with old versions of perplexica due to communication error from docker to ollama. Here are the configs:

app.dockerfile.txt config.toml.txt docker-compose.yaml.txt

the most important was using host network

here are docker run commands I use:

docker run --restart always --name perplexica-backend -e SEARXNG_API_URL=http://127.0.0.1:4000 --network=host -p 3001:3001 perplexica-perplexica-backend

docker run -d --restart always --name perplexica-frontend --network=host -p 3000:3000 perplexica-perplexica-frontend

To make it clear, I again retried setting up perplexica using standard guidlines in the github and I do not get communication to ollama even. With my setup I can see ollama models in perplexicty settings but error "Failed to connect to server. Please try again later" persists

mlario avatar Jul 23 '24 21:07 mlario

Describe the bug Several last updates made perplexica unusable on linux. I only get "Failed to connect to server. Please try again later" after doing search

With earlier version it was running though. Backend log is in attachments backend_log.txt

To Reproduce I run perplexica as docker on local vanilla Fedora linux. My ollama is run as systemd service. Searxng is run from a separate docker on port 4000, config of searxng includes json option

A month ago I had to do several modifications to make perplexica work even with old versions of perplexica due to communication error from docker to ollama. Here are the configs:

app.dockerfile.txt config.toml.txt docker-compose.yaml.txt

the most important was using host network

here are docker run commands I use:

docker run --restart always --name perplexica-backend -e SEARXNG_API_URL=http://127.0.0.1:4000 --network=host -p 3001:3001 perplexica-perplexica-backend

docker run -d --restart always --name perplexica-frontend --network=host -p 3000:3000 perplexica-perplexica-frontend

To make it clear, I again retried setting up perplexica using standard guidlines in the github and I do not get communication to ollama even. With my setup I can see ollama models in perplexicty settings but error "Failed to connect to server. Please try again later" persists

Why are you using host network? Follow the installation steps exactly and then follow this https://github.com/ItzCrazyKns/Perplexica?tab=readme-ov-file#ollama-connection-errors

ItzCrazyKns avatar Jul 24 '24 04:07 ItzCrazyKns

Describe the bug Several last updates made perplexica unusable on linux. I only get "Failed to connect to server. Please try again later" after doing search With earlier version it was running though. Backend log is in attachments backend_log.txt To Reproduce I run perplexica as docker on local vanilla Fedora linux. My ollama is run as systemd service. Searxng is run from a separate docker on port 4000, config of searxng includes json option A month ago I had to do several modifications to make perplexica work even with old versions of perplexica due to communication error from docker to ollama. Here are the configs: app.dockerfile.txt config.toml.txt docker-compose.yaml.txt the most important was using host network here are docker run commands I use: docker run --restart always --name perplexica-backend -e SEARXNG_API_URL=http://127.0.0.1:4000 --network=host -p 3001:3001 perplexica-perplexica-backend docker run -d --restart always --name perplexica-frontend --network=host -p 3000:3000 perplexica-perplexica-frontend To make it clear, I again retried setting up perplexica using standard guidlines in the github and I do not get communication to ollama even. With my setup I can see ollama models in perplexicty settings but error "Failed to connect to server. Please try again later" persists

Why are you using host network? Follow the installation steps exactly and then follow this https://github.com/ItzCrazyKns/Perplexica?tab=readme-ov-file#ollama-connection-errors

Well I tried following standard installation process and then following guide for connection error on linux.

As I mentioned before it failed and I could not get connection to ollama from perplexica - no models were listed in the settings

I use host network because this solution works, it is know issue connecting from docker containers to ollama on linux and was solved before with host network as described in openwebui: https://github.com/open-webui/open-webui?tab=readme-ov-file#open-webui-server-connection-error

Could you please give some hint regarding my backend log file, I think troubleshooting it will give me ability to solve the problem. I suspect there is an issue with communication to searxng: https://github.com/user-attachments/files/16354344/backend_log.txt

Thanks

mlario avatar Jul 24 '24 20:07 mlario

Describe the bug Several last updates made perplexica unusable on linux. I only get "Failed to connect to server. Please try again later" after doing search With earlier version it was running though. Backend log is in attachments backend_log.txt To Reproduce I run perplexica as docker on local vanilla Fedora linux. My ollama is run as systemd service. Searxng is run from a separate docker on port 4000, config of searxng includes json option A month ago I had to do several modifications to make perplexica work even with old versions of perplexica due to communication error from docker to ollama. Here are the configs: app.dockerfile.txt config.toml.txt docker-compose.yaml.txt the most important was using host network here are docker run commands I use: docker run --restart always --name perplexica-backend -e SEARXNG_API_URL=http://127.0.0.1:4000 --network=host -p 3001:3001 perplexica-perplexica-backend docker run -d --restart always --name perplexica-frontend --network=host -p 3000:3000 perplexica-perplexica-frontend To make it clear, I again retried setting up perplexica using standard guidlines in the github and I do not get communication to ollama even. With my setup I can see ollama models in perplexicty settings but error "Failed to connect to server. Please try again later" persists

Why are you using host network? Follow the installation steps exactly and then follow this https://github.com/ItzCrazyKns/Perplexica?tab=readme-ov-file#ollama-connection-errors

Well I tried following standard installation process and then following guide for connection error on linux.

As I mentioned before it failed and I could not get connection to ollama from perplexica - no models were listed in the settings

I use host network because this solution works, it is know issue connecting from docker containers to ollama on linux and was solved before with host network as described in openwebui: https://github.com/open-webui/open-webui?tab=readme-ov-file#open-webui-server-connection-error

Could you please give some hint regarding my backend log file, I think troubleshooting it will give me ability to solve the problem. I suspect there is an issue with communication to searxng: https://github.com/user-attachments/files/16354344/backend_log.txt

Thanks

If you use host network then the inter-container communication (over the docker network) wouldn't take place. So the address http://searxng:8080 doesn't exists on your actual host device.

ItzCrazyKns avatar Jul 25 '24 14:07 ItzCrazyKns

If a container runs in host networking mode, then it's like a service running on localhost. It has no access to Docker container networks. It only sees what's running on localhost. So to connect to searxng it will have to connect to whatever port searxng is using on localhost. And if the port isn't exposed, it needs to be exposed.

ProjectMoon avatar Jul 25 '24 16:07 ProjectMoon

the docker-compose.yaml also does not work OOTB

I have nothing running on port 4000 but

docker compose up -d [+] Running 2/3 ⠿ Container perplexica-searxng-1 Starting 0.2s ✔ Container perplexica-perplexica-backend-1 Created 0.0s ✔ Container perplexica-perplexica-frontend-1 Created 0.1s Error response from daemon: driver failed programming external connectivity on endpoint perplexica-searxng-1 (acb06cb3e02dacad375d5ce175ad07fcfa8a8ca4f5dd6f762ceb52c0c52e4037): failed to bind port 0.0.0.0:4000/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:4000: bind: address already in use

hugokoopmans avatar Aug 01 '24 15:08 hugokoopmans

Try sending a curl request to localhost:4000

ItzCrazyKns avatar Aug 01 '24 15:08 ItzCrazyKns

sorry my bad, appeared some othger service is there, moved port now it works OOTB

hugokoopmans avatar Aug 01 '24 16:08 hugokoopmans

http://searxng:8080

corrected this to 127.0.0.1:8080 and it worked, thanks!

mlario avatar Aug 15 '24 21:08 mlario