[GH-ISSUE #12480] ollama cli doesnt honor the proxy environement #8293

Closed
opened 2026-04-12 20:50:39 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @mofakhar on GitHub (Oct 2, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12480

What is the issue?

When running ollama cli in a container that is having proxy environment set, even if with no_proxy/NO_PROXY=localhost,127.0.0.1 when we execute the command ollama list we are getting the following error:

root@100b9b1ea2ed:/# ollama list
Error: invalid character '<' looking for beginning of value

Relevant log output

root@100b9b1ea2ed:/# ollama list
Error: invalid character '<' looking for beginning of value

OS

Docker

GPU

Nvidia

CPU

Intel

Ollama version

0.12.0

Originally created by @mofakhar on GitHub (Oct 2, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12480 ### What is the issue? When running ollama cli in a container that is having proxy environment set, even if with no_proxy/NO_PROXY=localhost,127.0.0.1 when we execute the command ollama list we are getting the following error: root@100b9b1ea2ed:/# ollama list Error: invalid character '<' looking for beginning of value ### Relevant log output ```shell root@100b9b1ea2ed:/# ollama list Error: invalid character '<' looking for beginning of value ``` ### OS Docker ### GPU Nvidia ### CPU Intel ### Ollama version 0.12.0
GiteaMirror added the bugneeds more info labels 2026-04-12 20:50:39 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 2, 2025):

I'm unable to duplicate. Server logs may help in debugging.

<!-- gh-comment-id:3362554060 --> @rick-github commented on GitHub (Oct 2, 2025): I'm unable to duplicate. [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may help in debugging.
Author
Owner

@mofakhar commented on GitHub (Oct 6, 2025):

when we setup environment variable within docker as below:

services:
ollama:
container_name: ollama
image: shared-bell-docker-dev.artifactory.int.bell.ca/ollama/ollama:0.12.3
restart: always
environment:
NVIDIA_VISIBLE_DEVICES: all
HTTPS_PROXY: http://entreprise.int.ca:8083
HTTP_PROXY: http://entreprise.int.ca:8083
NO_PROXY: 127.0.0.1,localhost,.entreprise.int.ca
http_proxy: http://entreprise.int.ca:8083
https_proxy: http://entreprise.int.ca:8083
no_proxy: 127.0.0.1,localhost,.entreprise.int.ca

ports:
  - "11434:11434"
volumes:
  - /home/portainer_containers/config/ai/ollama:/root/.ollama
runtime: nvidia
network_mode: bridge  # Podman uses CNI bridge by default
devices:
  - /dev/nvidia0
  - /dev/nvidia1
  - /dev/nvidia2
  - /dev/nvidiactl

The container start but when we execute the command ollama list from the container, we are getting the following error:

root@100b9b1ea2ed:/# ollama list
Error: invalid character '<' looking for beginning of value

So, even if no_proxy does have 127.0.0.1 and localhost its not working. So i have to remove the proxy environement variable to get the CLI command working

<!-- gh-comment-id:3372009312 --> @mofakhar commented on GitHub (Oct 6, 2025): when we setup environment variable within docker as below: --- services: ollama: container_name: ollama image: shared-bell-docker-dev.artifactory.int.bell.ca/ollama/ollama:0.12.3 restart: always environment: NVIDIA_VISIBLE_DEVICES: all HTTPS_PROXY: http://entreprise.int.ca:8083 HTTP_PROXY: http://entreprise.int.ca:8083 NO_PROXY: 127.0.0.1,localhost,.entreprise.int.ca http_proxy: http://entreprise.int.ca:8083 https_proxy: http://entreprise.int.ca:8083 no_proxy: 127.0.0.1,localhost,.entreprise.int.ca ports: - "11434:11434" volumes: - /home/portainer_containers/config/ai/ollama:/root/.ollama runtime: nvidia network_mode: bridge # Podman uses CNI bridge by default devices: - /dev/nvidia0 - /dev/nvidia1 - /dev/nvidia2 - /dev/nvidiactl The container start but when we execute the command ollama list from the container, we are getting the following error: root@100b9b1ea2ed:/# ollama list Error: invalid character '<' looking for beginning of value So, even if no_proxy does have 127.0.0.1 and localhost its not working. So i have to remove the proxy environement variable to get the CLI command working
Author
Owner

@rick-github commented on GitHub (Oct 6, 2025):

There's no need to set both uppercase and lowercase versions of the environment variables names.

What's the output of docker exec -it ollama env?

<!-- gh-comment-id:3372132238 --> @rick-github commented on GitHub (Oct 6, 2025): There's no need to set both uppercase and lowercase versions of the environment variables names. What's the output of `docker exec -it ollama env`?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#8293