ThinkFacility

Error messages

Error: invalid file magic

The message

Error: invalid file magic
Ollama 0.34.0 read September 26, 2026Ollamalocal modelsGGUF

What it means

Ollama opened a model file and its first four bytes weren't the GGUF signature, so it refused to read any further. The file is damaged, isn't a GGUF, or came from a format your Ollama version couldn't read yet.

What to do

If it happened on ollama run, remove the model and pull it again. If it happened on ollama create, update Ollama and check that the file really is a complete GGUF.

This one shows up at the end of an import or when a model is loaded to run. Here's how it looked in a report from August 2025 (#11961):

ollama create gpt-oss-20b -f Modelfile
gathering model components
copying file sha256:b112e727c6f1... 100%
parsing GGUF
Error: invalid file magic

A file's magic is its first few bytes, a fixed signature that says what kind of file it is. Every GGUF model file (the single-file format Ollama and llama.cpp run) starts with the letters GGUF. We read Ollama's model reader in 0.34.0, and it does exactly one thing before this error: it reads four bytes, compares them with that signature, and gives up if they don't match. As of September 26, 2026, 42 issues in the ollama/ollama repo quote the message.

Newer Ollama prints something else

That reader was deleted in 0.34.1 (September 2026), when Ollama stopped converting models itself and left GGUF creation to llama.cpp's tools. In 0.34.4 the same situation reads differently. ollama create with a file that isn't a GGUF stops at unknown type, or, if the name ends in .gguf, at unsupported file type followed by the four bytes it found. Loading a damaged model to run gives read GGUF metadata, the path, then that same unsupported file type. If you see "invalid file magic", you're on 0.34.0 or older.

When it happens on ollama run

If the model came from ollama pull and fails when you run it, the copy on disk is bad. In #8725 someone asked whether low VRAM could cause it, and collaborator rick-github answered that it "would not be the result of not enough VRAM. Most likely cause is a bad file." Pulling again over the top didn't help that reporter. Removing it first did:

ollama rm deepseek-r1:32b
ollama pull deepseek-r1:32b

rick-github's advice was to delete the old copy and any aliases of it (names made with ollama cp) before pulling.

When it happens on ollama create

Importing your own GGUF is where most of the reports come from, and the file isn't always broken. Four causes turn up in closed issues:

What to do

Update Ollama first, since two of those four were fixed by a newer release. Then compare the file's size with the size on the download page, and try the same file in llama.cpp: if llama.cpp loads it and current Ollama won't, that's worth an issue with the full output of ollama create.

Other lines the same feature prints

Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.

  • invalid file magic
  • unsupported file type
  • read GGUF metadata