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

project is broken on linux #281

Open
mlario opened this issue Jul 23, 2024 · 8 comments
Open

project is broken on linux #281

mlario opened this issue Jul 23, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@mlario
Copy link

mlario commented Jul 23, 2024

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 mlario added the bug Something isn't working label Jul 23, 2024
@ItzCrazyKns
Copy link
Owner

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

@mlario
Copy link
Author

mlario commented Jul 24, 2024

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

@ItzCrazyKns
Copy link
Owner

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.

@ProjectMoon
Copy link

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.

@hugokoopmans
Copy link

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

@ItzCrazyKns
Copy link
Owner

Try sending a curl request to localhost:4000

@hugokoopmans
Copy link

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

@mlario
Copy link
Author

mlario commented Aug 15, 2024

http://searxng:8080

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants