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

Cannot access Ollama, "ERR_NAME_NOT_RESOLVED" #138

Closed
ctrenthem159 opened this issue Sep 30, 2024 · 2 comments
Closed

Cannot access Ollama, "ERR_NAME_NOT_RESOLVED" #138

ctrenthem159 opened this issue Sep 30, 2024 · 2 comments

Comments

@ctrenthem159
Copy link

ctrenthem159 commented Sep 30, 2024

I'm using Grimoire, Ollama, and OpenWebUI in a single Docker Compose file, and while Openwebui can communicate with Ollama, Grimoire cannot.

Docker compose file:

  ollama:
    image: ollama/ollama
    container_name: ollama
    restart: unless-stopped
    networks: ['ollama']
    volumes:
      - ollama-root:/root/.ollama

  grimoire:
    image: goniszewski/grimoire:latest
    container_name: grimoire
    restart: unless-stopped
    networks: ['backend', 'ollama']
    environment:
      - PORT=5173
      - PUBLIC_HTTPS_ONLY=false
      - PUBLIC_ORIGIN=https://grimoire.DOMAIN
      - PUBLIC_SIGNUP_DISABLED=true
    volumes:
      - grimoire-data:/app/data

  openwebui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: openwebui
    restart: unless-stopped
    networks: ['backend', 'ollama']
    environment:
      - WEBUI_URL=https://ollama.DOMAIN
    volumes:
      - ollama-data:/app/backend/data

(associated top-level volumes and networks items here)

openwebui works:
image

image

but Grimoire does not:
image

If I try to access ollama from the host using the container name, I get this result

18:50:36 chris >> curl http://ollama:11434/api/tags
curl: (6) Could not resolve host: ollama

but when accessing it using it's IP (according to docker network inspect ollama)

18:50:31 chris >> curl 172.18.0.2:11434/api/tags
{"models":[{"name":"llama3.2:1b","model":"llama3.2:1b","modified_at":"2024-09-30T17:44:17.913431968Z","size":1321098329,"digest":"baf6a787fdffd633537aa2eb51cfd54cb93ff08e28040095462bb63daf552878","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"1.2B","quantization_level":"Q8_0"}}]}%

Grimoire and openwebui are behind a reverse proxy (NPM) with SSL enabled and other than not being able to access Ollama, everything else is working 100%.

@bnichms
Copy link

bnichms commented Dec 20, 2024

That's because the Ollama integration code is client-side, meaning the call originates from your web browser. Therefore, you need to provide the fully qualified domain name (FQDN)/ip address and port. Container names can only be used for communication between containers. External entities, such as your workstation or browser, need to use the FQDN of the host running the Ollama container. Additionally, you will need to expose the Ollama port externally.

@ctrenthem159
Copy link
Author

Understood, that makes sense.

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

2 participants