[GH-ISSUE #1337] API interface works fine, CLI returns non-descriptive error presumably due to proxy with Docker install #695

Closed
opened 2026-04-12 10:22:16 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @mlewis1973 on GitHub (Dec 1, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1337

Docker image installed on multiple Linux and Mac systems, both with and wo GPUs.
Local proxy settings set in daemon.json and well as passed to docker with -e and --env

API interface works fine, but CLI generates error for
'ollama run llama2'
'ollama list'
'ollama pull mistral'

ollama --version and --help do not generate error.
I even tried building the image with proxy hardcoded with ENVs in the Dockerfile... same error

Outside firewall, CLI works fine.

Originally created by @mlewis1973 on GitHub (Dec 1, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1337 Docker image installed on multiple Linux and Mac systems, both with and wo GPUs. Local proxy settings set in daemon.json and well as passed to docker with -e and --env API interface works fine, but CLI generates error for 'ollama run llama2' 'ollama list' 'ollama pull mistral' ollama --version and --help do not generate error. I even tried building the image with proxy hardcoded with ENVs in the Dockerfile... same error Outside firewall, CLI works fine.
GiteaMirror added the bugneeds more info labels 2026-04-12 10:22:16 -05:00
Author
Owner

@mlewis1973 commented on GitHub (Dec 1, 2023):

I would also note that the Ubuntu 22 base logging system is evidently not included in the Docker image

the error message is always:
Error: something went wrong, please see the ollama server logs for details
but there is no journalctl

<!-- gh-comment-id:1836471862 --> @mlewis1973 commented on GitHub (Dec 1, 2023): I would also note that the Ubuntu 22 base logging system is evidently not included in the Docker image the error message is always: Error: something went wrong, please see the ollama server logs for details but there is no journalctl
Author
Owner

@BruceMacD commented on GitHub (Dec 4, 2023):

Hey @mlewis1973, if you're behind a firewall you probably need to configure the HTTPS_PROXY environment variable.
https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-use-ollama-behind-a-proxy

Have you tried that?

<!-- gh-comment-id:1839620732 --> @BruceMacD commented on GitHub (Dec 4, 2023): Hey @mlewis1973, if you're behind a firewall you probably need to configure the `HTTPS_PROXY` environment variable. https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-use-ollama-behind-a-proxy Have you tried that?
Author
Owner

@mxyng commented on GitHub (Jan 20, 2024):

It seems likely the CLI also requires the proxy settings, not just the server. This would explain why the API, presumably with curl, works while the CLI does not. This should be fixed and uses HTTPS_PROXY to determine if and when proxy settings needs to be configured for the CLI

<!-- gh-comment-id:1901408720 --> @mxyng commented on GitHub (Jan 20, 2024): It seems likely the CLI also requires the proxy settings, not just the server. This would explain why the API, presumably with curl, works while the CLI does not. This should be fixed and uses HTTPS_PROXY to determine if and when proxy settings needs to be configured for the CLI
Author
Owner

@mlewis1973 commented on GitHub (Jan 24, 2024):

https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-use-ollama-behind-a-proxy

of course I tried the obvious....
from original issue:
"Local proxy settings set in daemon.json and well as passed to docker with -e and --env"

HTTPS_PROXY is clearly not the solution........

<!-- gh-comment-id:1908470149 --> @mlewis1973 commented on GitHub (Jan 24, 2024): > https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-use-ollama-behind-a-proxy of course I tried the obvious.... from original issue: "Local proxy settings set in daemon.json and well as passed to docker with -e and --env" HTTPS_PROXY is clearly not the solution........
Author
Owner

@mxyng commented on GitHub (Jan 25, 2024):

Please see #2168 which describes a possible failure scenarios when using HTTP_PROXY. If that doesn't represent your problem, please describe your issue in detail and we can determine if there's a bug somewhere

<!-- gh-comment-id:1910834072 --> @mxyng commented on GitHub (Jan 25, 2024): Please see #2168 which describes a possible failure scenarios when using `HTTP_PROXY`. If that doesn't represent your problem, please describe your issue in detail and we can determine if there's a bug somewhere
Author
Owner

@mchiang0610 commented on GitHub (Mar 12, 2024):

@mlewis1973 sorry about this. Are you still having this problem on the latest Ollama releases?

<!-- gh-comment-id:1992515779 --> @mchiang0610 commented on GitHub (Mar 12, 2024): @mlewis1973 sorry about this. Are you still having this problem on the latest Ollama releases?
Author
Owner

@lakako commented on GitHub (Mar 20, 2024):

I can reproduce this problem on ollama 0.1.29

<!-- gh-comment-id:2008716745 --> @lakako commented on GitHub (Mar 20, 2024): I can reproduce this problem on ollama 0.1.29
Author
Owner

@mxyng commented on GitHub (Aug 23, 2024):

It's not recommended to set HTTP_PROXY in the container. If the container is reused for ollama cli, HTTP_PROXY will proxy client requests through the configured proxy

<!-- gh-comment-id:2307809607 --> @mxyng commented on GitHub (Aug 23, 2024): It's not recommended to set `HTTP_PROXY` in the container. If the container is reused for ollama cli, `HTTP_PROXY` will proxy client requests through the configured proxy
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#695