[GH-ISSUE #3734] ollama create doesn't clean-up after 'creating model layer' failed #48811

Closed
opened 2026-04-28 09:22:51 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @PlanetMacro on GitHub (Apr 18, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3734

What is the issue?

If I try to create a model from local gguf files and the process exits with 'Error: invalid file magic' while performing 'creating model layer', the function does not clean up partial blobs that have been created. For larger models, this might build up substantial garbage data, that currently must be removed manually.

==================

Before the failed attempt to create a model:

user@debian-ai:~$ sudo du -ah / | awk '$1 ~ /G$/ && $1+0 > 10 {print}'
25G /usr/share/ollama/.ollama/models/blobs/sha256-e9e56e8bb5f0fcd4860675e6837a8f6a94e659f5fa7dce6a1076279336320f2b
94G /usr/share/ollama/.ollama/models/blobs/sha256-82440a94b304aa728bd12facfdc0eabe9ffcb3a64840be832401753f0bd8b0c0
47G /usr/share/ollama/.ollama/models/blobs/sha256-3a3c74c0bf306844ef6d255fbc4369769fd4a4c274f1fe9b6c55cf623cf56aed
[...]

Attempt to create the model:

user@debian-ai:~/Wizard-8x22B-Q5_K_M$ ollama create Wizard -f Modelfile
transferring model data
creating model layer
Error: invalid file magic

After the attempt:

user@debian-ai:~$ sudo du -ah / | awk '$1 ~ /G$/ && $1+0 > 10 {print}'
25G /usr/share/ollama/.ollama/models/blobs/sha256-e9e56e8bb5f0fcd4860675e6837a8f6a94e659f5fa7dce6a1076279336320f2b
22G /usr/share/ollama/.ollama/models/blobs/sha256-3939015911-partial
94G /usr/share/ollama/.ollama/models/blobs/sha256-82440a94b304aa728bd12facfdc0eabe9ffcb3a64840be832401753f0bd8b0c0
47G /usr/share/ollama/.ollama/models/blobs/sha256-3a3c74c0bf306844ef6d255fbc4369769fd4a4c274f1fe9b6c55cf623cf56aed
20G /usr/share/ollama/.ollama/models/blobs/sha256-24459609-partial
[...]

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.1.32

Originally created by @PlanetMacro on GitHub (Apr 18, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3734 ### What is the issue? If I try to create a model from local gguf files and the process exits with 'Error: invalid file magic' while performing 'creating model layer', the function does not clean up partial blobs that have been created. For larger models, this might build up substantial garbage data, that currently must be removed manually. ================== Before the failed attempt to create a model: user@debian-ai:~$ sudo du -ah / | awk '$1 ~ /G$/ && $1+0 > 10 {print}' 25G /usr/share/ollama/.ollama/models/blobs/sha256-e9e56e8bb5f0fcd4860675e6837a8f6a94e659f5fa7dce6a1076279336320f2b 94G /usr/share/ollama/.ollama/models/blobs/sha256-82440a94b304aa728bd12facfdc0eabe9ffcb3a64840be832401753f0bd8b0c0 47G /usr/share/ollama/.ollama/models/blobs/sha256-3a3c74c0bf306844ef6d255fbc4369769fd4a4c274f1fe9b6c55cf623cf56aed [...] Attempt to create the model: user@debian-ai:~/Wizard-8x22B-Q5_K_M$ ollama create Wizard -f Modelfile transferring model data creating model layer Error: invalid file magic After the attempt: user@debian-ai:~$ sudo du -ah / | awk '$1 ~ /G$/ && $1+0 > 10 {print}' 25G /usr/share/ollama/.ollama/models/blobs/sha256-e9e56e8bb5f0fcd4860675e6837a8f6a94e659f5fa7dce6a1076279336320f2b 22G /usr/share/ollama/.ollama/models/blobs/sha256-3939015911-partial 94G /usr/share/ollama/.ollama/models/blobs/sha256-82440a94b304aa728bd12facfdc0eabe9ffcb3a64840be832401753f0bd8b0c0 47G /usr/share/ollama/.ollama/models/blobs/sha256-3a3c74c0bf306844ef6d255fbc4369769fd4a4c274f1fe9b6c55cf623cf56aed 20G /usr/share/ollama/.ollama/models/blobs/sha256-24459609-partial [...] ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.1.32
GiteaMirror added the bug label 2026-04-28 09:22:51 -05:00
Author
Owner

@joshyan1 commented on GitHub (Jun 25, 2024):

Hey @PlanetMacro, are you still receiving this issue? If so, could you link the gguf file that you are using for import?

<!-- gh-comment-id:2190199301 --> @joshyan1 commented on GitHub (Jun 25, 2024): Hey @PlanetMacro, are you still receiving this issue? If so, could you link the gguf file that you are using for import?
Author
Owner

@jmorganca commented on GitHub (Jul 1, 2024):

Hi there, it seems this may have been an error fixed in newer versions of Ollama. Will close this for now but let us know if you're still seeing it @PlanetMacro

<!-- gh-comment-id:2200668984 --> @jmorganca commented on GitHub (Jul 1, 2024): Hi there, it seems this may have been an error fixed in newer versions of Ollama. Will close this for now but let us know if you're still seeing it @PlanetMacro
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48811