Perplexica: Failed to connect to the server. Please try again later.

Describe the bug

After actual code update

docker compose down
git pull
docker compose up -d --build

I cannot use perplexica.

Opening client displays “Failed to connect to the server. Please try again later.”

Additional context

docker logs perplexica-perplexica-backend-1
yarn run v1.22.22
$ npm run db:push && node dist/app.js

> perplexica-backend@1.9.0-rc2 db:push
> drizzle-kit push sqlite

drizzle-kit: v0.22.7
drizzle-orm: v0.31.2

No config path provided, using default path
Reading config file '/home/perplexica/drizzle.config.ts'
[⣷] Pulling schema from database...
[✓] Pulling schema from database...

[i] No changes detected
npm notice
npm notice New patch version of npm available! 10.8.2 -> 10.8.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3
npm notice To update run: npm install -g npm@10.8.3
npm notice
info: WebSocket server started on port 3001
(node:65) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info: Server is running on port 3001
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: undefined
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: undefined
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: undefined
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: Error loading Ollama models: TypeError: fetch failed
error: Error loading Ollama embeddings model: TypeError: fetch failed
error: undefined
docker-compose.yaml 
services:
  searxng:
    image: docker.io/searxng/searxng:latest
    volumes:
      - ./searxng:/etc/searxng:rw
    ports:
      - 4000:8080
    networks:
      - perplexica-network
    restart: unless-stopped

  perplexica-backend:
    build:
      context: .
      dockerfile: backend.dockerfile
      args:
        - SEARXNG_API_URL=http://searxng:8080
    depends_on:
      - searxng
    ports:
      - 3001:3001
    volumes:
      - backend-dbstore:/home/perplexica/data
      - ./config.toml:/home/perplexica/config.toml
    extra_hosts:
      - 'host.docker.internal:host-gateway'
    networks:
      - perplexica-network
    restart: unless-stopped

  perplexica-frontend:
    build:
      context: .
      dockerfile: app.dockerfile
      args:
        - NEXT_PUBLIC_API_URL=http://127.0.0.1:3001/api
        - NEXT_PUBLIC_WS_URL=ws://127.0.0.1:3001
    depends_on:
      - perplexica-backend
    ports:
      - 3000:3000
    networks:
      - perplexica-network
    restart: unless-stopped

networks:
  perplexica-network:

volumes:
  backend-dbstore:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29 (10 by maintainers)

Most upvoted comments

Should be fixed by https://github.com/ItzCrazyKns/Perplexica/commit/217736d05afeb5b10bb61827203f189b55b2c6cc, follow the update guide to update Perplexica to the latest version. Happy searching!!

I’ll try this other branch. Thx And so many thanks to you and the wonderful FOSS you made! You help AI to become a “common good”

There already exists a branch called admin-password which has password for confidential things like the settings. Consider closing this issue if your problem has been resolved

Make sure Ollama is accessible in via your LAN

As i am forwarding 3000 & 30001 ports on my machine, either 127.0.0.1 or localhost should work but i could break some “ws” connexions, as browser log indicate.

err1 load2

As Perplexica is running on IP 192.168.1.33 in my LAN I should try to change docker compose like this

  perplexica-frontend:
    build:
      context: .
      dockerfile: app.dockerfile
      args:
        - NEXT_PUBLIC_API_URL=http://192.168.1.33:3001/api
        - NEXT_PUBLIC_WS_URL=ws://192.168.1.33:3001

and access to http://192.168.1.33:3000

NB: As there is no login “ssh reverse tunnels” were used to access Perplexica from remote location over the Internet.

Yes but only access it in the private IP. If you tunnel and try to access it from outside the network it won’t work at all. Also you need to use private IP + port for Ollama and serve Ollama over the network.

@ItzCrazyKns with the latest version of perplexica , getting the same error with OpenAI Models , so its has nothing to do with Ollama or Docker Networking

What Ollama address are you using? And what operating system are you on