ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
10.67k stars 930 forks source link

error: undefined - MacOS Ollama #224

Open nicolas-g opened 5 days ago

nicolas-g commented 5 days ago

Describe the bug I'm not able to search running Perplexica as a docker container locally and Ollama.

To Reproduce

Ollama installation

$ brew install ollama 
$ brew services start ollama
$ ollama pull llama3:latest

confirm the service is working

$ curl  http://127.0.0.1:11434

Ollama is running%

config file:

[API_ENDPOINTS]
SEARXNG = "http://localhost:32768" # SearxNG API URL
OLLAMA = "http://host.docker.internal:11434"

open http://localhost:3000 and do any search ...

Expected behavior Perplexica be able to return answers for any query with no errors

Additional context

Anytime I try to search for something I see error: undefined in the log entries:

docker logs perplexica-perplexica-backend-1 -f
yarn run v1.22.19
$ node dist/app.js
info: WebSocket server started on port 3001
info: Server is running on port 3001

error: undefined
error: undefined
ItzCrazyKns commented 5 days ago

Tried reproducing but couldn't see anything, can you provide more information? Can you provide a screenshot of the settings menu.

delfireinoso commented 5 days ago

I run Perplexica on a Mac. Ollama is running on the Mac app because I see when Ollama has a pending update with the icon.

if you follow the Perplexica compose installation, and you put OLLAMA = "http://host.docker.internal:11434" on the Config.toml file you should have Perplexica running.

By default Perplexica frontend is on localhost:3000, see if you have anything listening there

Arun-chaitanya commented 2 days ago

Getting the same bug

Arun-chaitanya commented 2 days ago
Screenshot 2024-06-29 at 3 00 41 PM

When I try to run it for first time.

ItzCrazyKns commented 2 days ago

Screenshot 2024-06-29 at 3 00 41 PM When I try to run it for first time.

What are the logs from the backend container

Arun-chaitanya commented 2 days ago
2024-06-29 15:08:06 yarn run v1.22.19
2024-06-29 15:08:06 $ node dist/app.js
2024-06-29 15:08:06 info: WebSocket server started on port 3001
2024-06-29 15:08:06 info: Server is running on port 3001
2024-06-29 15:08:15 error: undefined
2024-06-29 15:08:16 error: undefined
2024-06-29 15:08:25 node:internal/process/promises:289
2024-06-29 15:08:25             triggerUncaughtException(err, true /* fromPromise */);
2024-06-29 15:08:25             ^
2024-06-29 15:08:25 
2024-06-29 15:08:25 TypeError: Invalid URL
2024-06-29 15:08:25     at new URL (node:internal/url:775:36)
2024-06-29 15:08:25     at OpenAI.buildURL (/home/perplexica/node_modules/openai/core.js:318:15)
2024-06-29 15:08:25     at OpenAI.buildRequest (/home/perplexica/node_modules/openai/core.js:199:26)
2024-06-29 15:08:25     at OpenAI.makeRequest (/home/perplexica/node_modules/openai/core.js:274:44)
2024-06-29 15:08:25     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-06-29 15:08:25     at async /home/perplexica/node_modules/@langchain/openai/dist/chat_models.cjs:684:29
2024-06-29 15:08:25     at async RetryOperation._fn (/home/perplexica/node_modules/p-retry/index.js:50:12) {
2024-06-29 15:08:25   code: 'ERR_INVALID_URL',
2024-06-29 15:08:25   input: 'null/chat/completions'
2024-06-29 15:08:25 }
2024-06-29 15:08:25 
2024-06-29 15:08:25 Node.js v20.8.1
2024-06-29 15:08:25 error Command failed with exit code 1.
2024-06-29 15:08:25 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2024-06-29 15:08:25 yarn run v1.22.19
2024-06-29 15:08:25 $ node dist/app.js
2024-06-29 15:08:25 info: WebSocket server started on port 3001
2024-06-29 15:08:25 info: Server is running on port 3001
ItzCrazyKns commented 1 day ago
2024-06-29 15:08:06 yarn run v1.22.19
2024-06-29 15:08:06 $ node dist/app.js
2024-06-29 15:08:06 info: WebSocket server started on port 3001
2024-06-29 15:08:06 info: Server is running on port 3001
2024-06-29 15:08:15 error: undefined
2024-06-29 15:08:16 error: undefined
2024-06-29 15:08:25 node:internal/process/promises:289
2024-06-29 15:08:25             triggerUncaughtException(err, true /* fromPromise */);
2024-06-29 15:08:25             ^
2024-06-29 15:08:25 
2024-06-29 15:08:25 TypeError: Invalid URL
2024-06-29 15:08:25     at new URL (node:internal/url:775:36)
2024-06-29 15:08:25     at OpenAI.buildURL (/home/perplexica/node_modules/openai/core.js:318:15)
2024-06-29 15:08:25     at OpenAI.buildRequest (/home/perplexica/node_modules/openai/core.js:199:26)
2024-06-29 15:08:25     at OpenAI.makeRequest (/home/perplexica/node_modules/openai/core.js:274:44)
2024-06-29 15:08:25     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-06-29 15:08:25     at async /home/perplexica/node_modules/@langchain/openai/dist/chat_models.cjs:684:29
2024-06-29 15:08:25     at async RetryOperation._fn (/home/perplexica/node_modules/p-retry/index.js:50:12) {
2024-06-29 15:08:25   code: 'ERR_INVALID_URL',
2024-06-29 15:08:25   input: 'null/chat/completions'
2024-06-29 15:08:25 }
2024-06-29 15:08:25 
2024-06-29 15:08:25 Node.js v20.8.1
2024-06-29 15:08:25 error Command failed with exit code 1.
2024-06-29 15:08:25 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2024-06-29 15:08:25 yarn run v1.22.19
2024-06-29 15:08:25 $ node dist/app.js
2024-06-29 15:08:25 info: WebSocket server started on port 3001
2024-06-29 15:08:25 info: Server is running on port 3001

Have you configured the OpenAI API key or the Groq API key or the Ollama address? Once of them is required for Perplexica to work.