[GH-ISSUE #10839] /usr/share/ollama isn't usable as a symlink #7118

Closed
opened 2026-04-12 19:07:20 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @roycewilliams on GitHub (May 24, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10839

What is the issue?

If /usr/share/ollama is a symlink to a valid directory, ollama incorrectly to create a directory, and fails.

Steps to recreate:

$ file /usr/share/ollama
/usr/share/ollama: symbolic link to /other/path/ollama

$ file /other/path/ollama
/other/path/ollama: directory

$ touch /usr/share/ollama/test

$ ls -la /usr/share/ollama/test
-rw-r----- 1 user user 0 May 23 16:24 /usr/share/ollama/test

$ ollama list
Error: mkdir /usr/share/ollama: file exists

Relevant log output


OS

Ubuntu 24.04.2

GPU

n/a

CPU

n/a

Ollama version

ollama version is 0.5.1

Originally created by @roycewilliams on GitHub (May 24, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10839 ### What is the issue? If `/usr/share/ollama` is a symlink to a valid directory, ollama incorrectly to create a directory, and fails. Steps to recreate: ``` $ file /usr/share/ollama /usr/share/ollama: symbolic link to /other/path/ollama $ file /other/path/ollama /other/path/ollama: directory $ touch /usr/share/ollama/test $ ls -la /usr/share/ollama/test -rw-r----- 1 user user 0 May 23 16:24 /usr/share/ollama/test $ ollama list Error: mkdir /usr/share/ollama: file exists ``` ### Relevant log output ```shell ``` ### OS Ubuntu 24.04.2 ### GPU n/a ### CPU n/a ### Ollama version ollama version is 0.5.1
GiteaMirror added the bug label 2026-04-12 19:07:20 -05:00
Author
Owner

@rick-github commented on GitHub (May 24, 2025):

The target directory has to be writable by the ollama user.

$ file /usr/share/ollama
/usr/share/ollama: symbolic link to /tmp
$ ls -lR /tmp/.ollama
/tmp/.ollama:
total 12
-rw------- 1 ollama ollama  387 Mai 24 02:39 id_ed25519
-rw-r--r-- 1 ollama ollama   81 Mai 24 02:39 id_ed25519.pub
drwxr-xr-x 4 ollama ollama 4096 Mai 24 02:39 models

/tmp/.ollama/models:
total 8
drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:39 blobs
drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:39 manifests

/tmp/.ollama/models/blobs:
total 0

/tmp/.ollama/models/manifests:
total 0
$ ollama pull qwen2.5:0.5b
pulling manifest 
pulling c5396e06af29: 100% ▕█████████████████████████████████████████████████████████████████▏ 397 MB                         
pulling 66b9ea09bd5b: 100% ▕█████████████████████████████████████████████████████████████████▏   68 B                         
pulling eb4402837c78: 100% ▕█████████████████████████████████████████████████████████████████▏ 1.5 KB                         
pulling 832dd9e00a68: 100% ▕█████████████████████████████████████████████████████████████████▏  11 KB                         
pulling 005f95c74751: 100% ▕█████████████████████████████████████████████████████████████████▏  490 B                         
verifying sha256 digest 
writing manifest 
success 
$ ls -lR /tmp/.ollama
/tmp/.ollama:
total 12
-rw------- 1 ollama ollama  387 Mai 24 02:39 id_ed25519
-rw-r--r-- 1 ollama ollama   81 Mai 24 02:39 id_ed25519.pub
drwxr-xr-x 4 ollama ollama 4096 Mai 24 02:39 models

/tmp/.ollama/models:
total 8
drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:43 blobs
drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 manifests

/tmp/.ollama/models/blobs:
total 388516
-rw-r--r-- 1 ollama ollama       490 Mai 24 02:43 sha256-005f95c7475154a17e84b85cd497949d6dd2a4f9d77c096e3c66e4d9c32acaf5
-rw-r--r-- 1 ollama ollama        68 Mai 24 02:43 sha256-66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e
-rw-r--r-- 1 ollama ollama     11343 Mai 24 02:43 sha256-832dd9e00a68dd83b3c3fb9f5588dad7dcf337a0db50f7d9483f310cd292e92e
-rw-r--r-- 1 ollama ollama 397807936 Mai 24 02:43 sha256-c5396e06af294bd101b30dce59131a76d2b773e76950acc870eda801d3ab0515
-rw-r--r-- 1 ollama ollama      1482 Mai 24 02:43 sha256-eb4402837c7829a690fa845de4d7f3fd842c2adee476d5341da8a46ea9255175

/tmp/.ollama/models/manifests:
total 4
drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 registry.ollama.ai

/tmp/.ollama/models/manifests/registry.ollama.ai:
total 4
drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 library

/tmp/.ollama/models/manifests/registry.ollama.ai/library:
total 4
drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:43 qwen2.5

/tmp/.ollama/models/manifests/registry.ollama.ai/library/qwen2.5:
total 4
-rw-r--r-- 1 ollama ollama 857 Mai 24 02:43 0.5b
$ ollama list
NAME            ID              SIZE      MODIFIED      
qwen2.5:0.5b    a8b0c5157701    397 MB    2 minutes ago  
<!-- gh-comment-id:2906143836 --> @rick-github commented on GitHub (May 24, 2025): The target directory has to be writable by the ollama user. ```console $ file /usr/share/ollama /usr/share/ollama: symbolic link to /tmp $ ls -lR /tmp/.ollama /tmp/.ollama: total 12 -rw------- 1 ollama ollama 387 Mai 24 02:39 id_ed25519 -rw-r--r-- 1 ollama ollama 81 Mai 24 02:39 id_ed25519.pub drwxr-xr-x 4 ollama ollama 4096 Mai 24 02:39 models /tmp/.ollama/models: total 8 drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:39 blobs drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:39 manifests /tmp/.ollama/models/blobs: total 0 /tmp/.ollama/models/manifests: total 0 $ ollama pull qwen2.5:0.5b pulling manifest pulling c5396e06af29: 100% ▕█████████████████████████████████████████████████████████████████▏ 397 MB pulling 66b9ea09bd5b: 100% ▕█████████████████████████████████████████████████████████████████▏ 68 B pulling eb4402837c78: 100% ▕█████████████████████████████████████████████████████████████████▏ 1.5 KB pulling 832dd9e00a68: 100% ▕█████████████████████████████████████████████████████████████████▏ 11 KB pulling 005f95c74751: 100% ▕█████████████████████████████████████████████████████████████████▏ 490 B verifying sha256 digest writing manifest success $ ls -lR /tmp/.ollama /tmp/.ollama: total 12 -rw------- 1 ollama ollama 387 Mai 24 02:39 id_ed25519 -rw-r--r-- 1 ollama ollama 81 Mai 24 02:39 id_ed25519.pub drwxr-xr-x 4 ollama ollama 4096 Mai 24 02:39 models /tmp/.ollama/models: total 8 drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:43 blobs drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 manifests /tmp/.ollama/models/blobs: total 388516 -rw-r--r-- 1 ollama ollama 490 Mai 24 02:43 sha256-005f95c7475154a17e84b85cd497949d6dd2a4f9d77c096e3c66e4d9c32acaf5 -rw-r--r-- 1 ollama ollama 68 Mai 24 02:43 sha256-66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e -rw-r--r-- 1 ollama ollama 11343 Mai 24 02:43 sha256-832dd9e00a68dd83b3c3fb9f5588dad7dcf337a0db50f7d9483f310cd292e92e -rw-r--r-- 1 ollama ollama 397807936 Mai 24 02:43 sha256-c5396e06af294bd101b30dce59131a76d2b773e76950acc870eda801d3ab0515 -rw-r--r-- 1 ollama ollama 1482 Mai 24 02:43 sha256-eb4402837c7829a690fa845de4d7f3fd842c2adee476d5341da8a46ea9255175 /tmp/.ollama/models/manifests: total 4 drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 registry.ollama.ai /tmp/.ollama/models/manifests/registry.ollama.ai: total 4 drwxr-xr-x 3 ollama ollama 4096 Mai 24 02:43 library /tmp/.ollama/models/manifests/registry.ollama.ai/library: total 4 drwxr-xr-x 2 ollama ollama 4096 Mai 24 02:43 qwen2.5 /tmp/.ollama/models/manifests/registry.ollama.ai/library/qwen2.5: total 4 -rw-r--r-- 1 ollama ollama 857 Mai 24 02:43 0.5b $ ollama list NAME ID SIZE MODIFIED qwen2.5:0.5b a8b0c5157701 397 MB 2 minutes ago ```
Author
Owner

@roycewilliams commented on GitHub (May 24, 2025):

It is (and if it wasn't, wouldn't the error have been different?)

$ ls -lad /other/path/ollama
drwxr-xr-x 2 ollama ollama 3 May 23 16:24 /other/path/ollama

$ ollama list
Error: mkdir /usr/share/ollama: file exists

The error seems to specifically be due to an attempt to create /usr/share/ollama - apologies, what am I missing?

<!-- gh-comment-id:2906500674 --> @roycewilliams commented on GitHub (May 24, 2025): It is (and if it wasn't, wouldn't the error have been different?) ``` $ ls -lad /other/path/ollama drwxr-xr-x 2 ollama ollama 3 May 23 16:24 /other/path/ollama $ ollama list Error: mkdir /usr/share/ollama: file exists ``` The error seems to specifically be due to an attempt to create `/usr/share/ollama` - apologies, what am I missing?
Author
Owner

@rick-github commented on GitHub (May 24, 2025):

Are all elements of the path traversable by the ollama user? What's the output of the following:

p="/other/path/ollama"; ls -ld / $(while [ "$p" != "/" ]; do echo "$p"; p=$(dirname "$p"); done | tac)
<!-- gh-comment-id:2906507877 --> @rick-github commented on GitHub (May 24, 2025): Are all elements of the path traversable by the ollama user? What's the output of the following: ``` p="/other/path/ollama"; ls -ld / $(while [ "$p" != "/" ]; do echo "$p"; p=$(dirname "$p"); done | tac) ```
Author
Owner

@roycewilliams commented on GitHub (May 24, 2025):

That was it! There was an intermediate subdirectory that was not o+rx.

Long shot, I know, but ... is there any possibility for the error to be tuned to be more accurate? As it occurs today, it's throwing what's actually an inapplicable error.

<!-- gh-comment-id:2906509833 --> @roycewilliams commented on GitHub (May 24, 2025): That was it! There was an intermediate subdirectory that was not o+rx. Long shot, I know, but ... is there any possibility for the error to be tuned to be more accurate? As it occurs today, it's throwing what's actually an inapplicable error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7118