[GH-ISSUE #4674] any command but serve get errors,when using proxy #28699

Closed
opened 2026-04-22 07:12:50 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @lingfengchencn on GitHub (May 28, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4674

What is the issue?

when I configure http_proxy/ https_proxy / HTTP_PROXY / HTTPS_PROXY in docker-compose, ollama serve runs well, but other commands get errors.

here is my yaml

version: '3.8'
name: "dev-ollama"
services:
  ollama:
    image: ollama/ollama
    environment:
      - OLLAMA_DEBUG=1
      - http_proxy=http://host.docker.internal:7890
      - https_proxy=http://host.docker.internal:7890
      - HTTP_PROXY=http://host.docker.internal:7890
      - HTTPS_PROXY=http://host.docker.internal:7890
      - NO_PROXY=localhost,127.0.0.1,.aliyun.com
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./ollama:/root/.ollama
    ports:
      - "11434:11434"
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              device_ids: ['0']
              capabilities: [gpu]
    logging:
      driver: "json-file"
      options:
        max-size: "10m"  
        max-file: "3"    
    restart: unless-stopped

after starting success, I run these commands:

root@4699c7ce936d:/# ollama run
Error: requires at least 1 arg(s), only received 0
root@4699c7ce936d:/# ollama run llama3
Error: something went wrong, please see the Ollama server logs for details
root@4699c7ce936d:/# ollama ps
Error: something went wrong, please see the Ollama server logs for details

and there are no logs...except started logs

(base) [root@ ... docker]# docker compose up ollama
[+] Building 0.0s (0/0)                                                                                                                                                
[+] Running 2/2
 ✔ Volume "dev-ollama_ollama"     Created                                                                                                                         0.0s 
 ✔ Container dev-ollama-ollama-1  Recreated                                                                                                                       0.1s 
Attaching to dev-ollama-ollama-1
dev-ollama-ollama-1  | Couldn't find '/root/.ollama/id_ed25519'. Generating new private key.
dev-ollama-ollama-1  | Your new public key is: 
dev-ollama-ollama-1  | 
dev-ollama-ollama-1  | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmaya1CaoLoxW9yezdS1bkOx5lxQr9/8qyvxk0RzmSd
dev-ollama-ollama-1  | 
dev-ollama-ollama-1  | 2024/05/28 06:40:53 routes.go:1008: INFO server config env="map[OLLAMA_DEBUG:true OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:1 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:*] OLLAMA_RUNNERS_DIR: OLLAMA_TMPDIR:]"
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.928Z level=INFO source=images.go:704 msg="total blobs: 0"
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.928Z level=INFO source=images.go:711 msg="total unused blobs removed: 0"
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=INFO source=routes.go:1054 msg="Listening on [::]:11434 (version 0.1.38)"
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=INFO source=payload.go:30 msg="extracting embedded files" dir=/tmp/ollama980004349/runners
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu file=build/linux/x86_64/cpu/bin/ollama_llama_server.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu_avx file=build/linux/x86_64/cpu_avx/bin/ollama_llama_server.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu_avx2 file=build/linux/x86_64/cpu_avx2/bin/ollama_llama_server.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcublas.so.11.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcublasLt.so.11.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcudart.so.11.0.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/ollama_llama_server.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=rocm_v60002 file=build/linux/x86_64/rocm_v60002/bin/deps.txt.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=rocm_v60002 file=build/linux/x86_64/rocm_v60002/bin/ollama_llama_server.gz
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu_avx
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu_avx2
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cuda_v11
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/rocm_v60002
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=INFO source=payload.go:44 msg="Dynamic LLM libraries [cpu cpu_avx cpu_avx2 cuda_v11 rocm_v60002]"
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:45 msg="Override detection logic by setting OLLAMA_LLM_LIBRARY"
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=sched.go:90 msg="starting llm scheduler"
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:122 msg="Detecting GPUs"
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:261 msg="Searching for GPU library" name=libcuda.so*
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:280 msg="gpu library search" globs="[/usr/local/nvidia/lib/libcuda.so** /usr/local/nvidia/lib64/libcuda.so** /usr/local/cuda*/targets/*/lib/libcuda.so* /usr/lib/*-linux-gnu/nvidia/current/libcuda.so* /usr/lib/*-linux-gnu/libcuda.so* /usr/lib/wsl/lib/libcuda.so* /usr/lib/wsl/drivers/*/libcuda.so* /opt/cuda/lib*/libcuda.so* /usr/local/cuda/lib*/libcuda.so* /usr/lib*/libcuda.so* /usr/local/lib*/libcuda.so*]"
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.731Z level=DEBUG source=gpu.go:313 msg="discovered GPU libraries" paths=[/usr/lib/x86_64-linux-gnu/libcuda.so.525.116.04]
dev-ollama-ollama-1  | CUDA driver version: 12.0
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.739Z level=DEBUG source=gpu.go:127 msg="detected GPUs" count=1 library=/usr/lib/x86_64-linux-gnu/libcuda.so.525.116.04
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.739Z level=DEBUG source=cpu_common.go:11 msg="CPU has AVX2"
dev-ollama-ollama-1  | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] CUDA totalMem 32500 mb
dev-ollama-ollama-1  | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] CUDA freeMem 10968 mb
dev-ollama-ollama-1  | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] Compute Capability 7.0
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.854Z level=DEBUG source=amd_linux.go:322 msg="amdgpu driver not detected /sys/module/amdgpu"
dev-ollama-ollama-1  | releasing nvcuda library
dev-ollama-ollama-1  | time=2024-05-28T06:40:57.854Z level=INFO source=types.go:71 msg="inference compute" id=GPU-ac0f5b80-9816-9909-12f0-23878ea93215 library=cuda compute=7.0 driver=12.0 name="Tesla V100-SXM2-32GB" total="31.7 GiB" available="10.7 GiB"
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Stopping 1/1
 ✔ Container dev-ollama-ollama-1  Stopped   

BUT if i removed http_proxy ,it works fine.

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.38

Originally created by @lingfengchencn on GitHub (May 28, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4674 ### What is the issue? when I configure http_proxy/ https_proxy / HTTP_PROXY / HTTPS_PROXY in docker-compose, `ollama serve` runs well, but other commands get errors. here is my yaml ```yaml version: '3.8' name: "dev-ollama" services: ollama: image: ollama/ollama environment: - OLLAMA_DEBUG=1 - http_proxy=http://host.docker.internal:7890 - https_proxy=http://host.docker.internal:7890 - HTTP_PROXY=http://host.docker.internal:7890 - HTTPS_PROXY=http://host.docker.internal:7890 - NO_PROXY=localhost,127.0.0.1,.aliyun.com extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./ollama:/root/.ollama ports: - "11434:11434" deploy: resources: reservations: devices: - driver: nvidia device_ids: ['0'] capabilities: [gpu] logging: driver: "json-file" options: max-size: "10m" max-file: "3" restart: unless-stopped ``` after starting success, I run these commands: ``` root@4699c7ce936d:/# ollama run Error: requires at least 1 arg(s), only received 0 root@4699c7ce936d:/# ollama run llama3 Error: something went wrong, please see the Ollama server logs for details root@4699c7ce936d:/# ollama ps Error: something went wrong, please see the Ollama server logs for details ``` and there are no logs...except started logs ``` (base) [root@ ... docker]# docker compose up ollama [+] Building 0.0s (0/0) [+] Running 2/2 ✔ Volume "dev-ollama_ollama" Created 0.0s ✔ Container dev-ollama-ollama-1 Recreated 0.1s Attaching to dev-ollama-ollama-1 dev-ollama-ollama-1 | Couldn't find '/root/.ollama/id_ed25519'. Generating new private key. dev-ollama-ollama-1 | Your new public key is: dev-ollama-ollama-1 | dev-ollama-ollama-1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmaya1CaoLoxW9yezdS1bkOx5lxQr9/8qyvxk0RzmSd dev-ollama-ollama-1 | dev-ollama-ollama-1 | 2024/05/28 06:40:53 routes.go:1008: INFO server config env="map[OLLAMA_DEBUG:true OLLAMA_LLM_LIBRARY: OLLAMA_MAX_LOADED_MODELS:1 OLLAMA_MAX_QUEUE:512 OLLAMA_MAX_VRAM:0 OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:1 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:*] OLLAMA_RUNNERS_DIR: OLLAMA_TMPDIR:]" dev-ollama-ollama-1 | time=2024-05-28T06:40:53.928Z level=INFO source=images.go:704 msg="total blobs: 0" dev-ollama-ollama-1 | time=2024-05-28T06:40:53.928Z level=INFO source=images.go:711 msg="total unused blobs removed: 0" dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=INFO source=routes.go:1054 msg="Listening on [::]:11434 (version 0.1.38)" dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=INFO source=payload.go:30 msg="extracting embedded files" dir=/tmp/ollama980004349/runners dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu file=build/linux/x86_64/cpu/bin/ollama_llama_server.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu_avx file=build/linux/x86_64/cpu_avx/bin/ollama_llama_server.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cpu_avx2 file=build/linux/x86_64/cpu_avx2/bin/ollama_llama_server.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcublas.so.11.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcublasLt.so.11.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/libcudart.so.11.0.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=cuda_v11 file=build/linux/x86_64/cuda_v11/bin/ollama_llama_server.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=rocm_v60002 file=build/linux/x86_64/rocm_v60002/bin/deps.txt.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:53.929Z level=DEBUG source=payload.go:180 msg=extracting variant=rocm_v60002 file=build/linux/x86_64/rocm_v60002/bin/ollama_llama_server.gz dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu_avx dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cpu_avx2 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/cuda_v11 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:71 msg="availableServers : found" file=/tmp/ollama980004349/runners/rocm_v60002 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=INFO source=payload.go:44 msg="Dynamic LLM libraries [cpu cpu_avx cpu_avx2 cuda_v11 rocm_v60002]" dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=payload.go:45 msg="Override detection logic by setting OLLAMA_LLM_LIBRARY" dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=sched.go:90 msg="starting llm scheduler" dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:122 msg="Detecting GPUs" dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:261 msg="Searching for GPU library" name=libcuda.so* dev-ollama-ollama-1 | time=2024-05-28T06:40:57.730Z level=DEBUG source=gpu.go:280 msg="gpu library search" globs="[/usr/local/nvidia/lib/libcuda.so** /usr/local/nvidia/lib64/libcuda.so** /usr/local/cuda*/targets/*/lib/libcuda.so* /usr/lib/*-linux-gnu/nvidia/current/libcuda.so* /usr/lib/*-linux-gnu/libcuda.so* /usr/lib/wsl/lib/libcuda.so* /usr/lib/wsl/drivers/*/libcuda.so* /opt/cuda/lib*/libcuda.so* /usr/local/cuda/lib*/libcuda.so* /usr/lib*/libcuda.so* /usr/local/lib*/libcuda.so*]" dev-ollama-ollama-1 | time=2024-05-28T06:40:57.731Z level=DEBUG source=gpu.go:313 msg="discovered GPU libraries" paths=[/usr/lib/x86_64-linux-gnu/libcuda.so.525.116.04] dev-ollama-ollama-1 | CUDA driver version: 12.0 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.739Z level=DEBUG source=gpu.go:127 msg="detected GPUs" count=1 library=/usr/lib/x86_64-linux-gnu/libcuda.so.525.116.04 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.739Z level=DEBUG source=cpu_common.go:11 msg="CPU has AVX2" dev-ollama-ollama-1 | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] CUDA totalMem 32500 mb dev-ollama-ollama-1 | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] CUDA freeMem 10968 mb dev-ollama-ollama-1 | [GPU-ac0f5b80-9816-9909-12f0-23878ea93215] Compute Capability 7.0 dev-ollama-ollama-1 | time=2024-05-28T06:40:57.854Z level=DEBUG source=amd_linux.go:322 msg="amdgpu driver not detected /sys/module/amdgpu" dev-ollama-ollama-1 | releasing nvcuda library dev-ollama-ollama-1 | time=2024-05-28T06:40:57.854Z level=INFO source=types.go:71 msg="inference compute" id=GPU-ac0f5b80-9816-9909-12f0-23878ea93215 library=cuda compute=7.0 driver=12.0 name="Tesla V100-SXM2-32GB" total="31.7 GiB" available="10.7 GiB" ^CGracefully stopping... (press Ctrl+C again to force) Aborting on container exit... [+] Stopping 1/1 ✔ Container dev-ollama-ollama-1 Stopped ``` BUT if i removed http_proxy ,it works fine. ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.38
GiteaMirror added the bug label 2026-04-22 07:12:50 -05:00
Author
Owner

@semae commented on GitHub (Jun 18, 2024):

Same error when running on Windows native, no Docker. It worked before, now all commands return "Error: something went wrong, please see the ollama server logs for details"

<!-- gh-comment-id:2175802336 --> @semae commented on GitHub (Jun 18, 2024): Same error when running on Windows native, no Docker. It worked before, now all commands return "Error: something went wrong, please see the ollama server logs for details"
Author
Owner

@mxyng commented on GitHub (Jun 18, 2024):

HTTP_PROXY apply to http requests i.e. the requests from ollama client to the server which is unlikely what you want. removing those lines from the docker config should resolve your problem.

re: NO_PROXY is set but doesn't match the client's host set by OLLAMA_HOST to 0.0.0.0. therefore you can optionally set NO_PROXY=0.0.0.0

<!-- gh-comment-id:2176553846 --> @mxyng commented on GitHub (Jun 18, 2024): `HTTP_PROXY` apply to http requests i.e. the requests from ollama client to the server which is unlikely what you want. removing those lines from the docker config should resolve your problem. re: NO_PROXY is set but doesn't match the client's host set by `OLLAMA_HOST` to 0.0.0.0. therefore you can optionally set `NO_PROXY=0.0.0.0`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#28699