ollama/ollama · error
%s: seek failed path=%s offset=%zu size=%zu errno=%d (%s)\n
Error message
%s: seek failed path=%s offset=%zu size=%zu errno=%d (%s)\n
What it means
Logged to stderr by read_at() when fseeko (or _fseeki64 on Windows) fails after the GGUF blob file was successfully opened. The offset/size/errno are printed and read_at returns false. Seek failures mean the file handle is valid but the read position could not be moved — almost always a large-file (>2GiB) support problem or a truncated/irregular file.
Source
Thrown at llama/compat/llama-ollama-compat-util.cpp:292
return true;
}
bool read_at(const char * path, size_t offset, void * dst, size_t size) {
FILE * f = ggml_fopen(path, "rb");
if (!f) {
std::fprintf(stderr, "%s: open failed path=%s offset=%zu size=%zu errno=%d (%s)\n",
__func__, path, offset, size, errno, std::strerror(errno));
return false;
}
errno = 0;
#if defined(_WIN32)
const int seek_rc = _fseeki64(f, static_cast<__int64>(offset), SEEK_SET);
#else
const int seek_rc = fseeko(f, static_cast<off_t>(offset), SEEK_SET);
#endif
if (seek_rc != 0) {
std::fprintf(stderr, "%s: seek failed path=%s offset=%zu size=%zu errno=%d (%s)\n",
__func__, path, offset, size, errno, std::strerror(errno));
std::fclose(f);
return false;
}
const size_t n = std::fread(dst, 1, size, f);
const bool ok = n == size;
if (!ok) {
std::fprintf(stderr, "%s: read failed path=%s offset=%zu size=%zu got=%zu errno=%d (%s) ferror=%d\n",
__func__, path, offset, size, n, errno, std::strerror(errno), std::ferror(f));
}
std::fclose(f);
return ok;
}
// -------------------------------------------------------------------------
// Common high-level transforms
// -------------------------------------------------------------------------View on GitHub (pinned to e5a81899d0)
Solutions
- Check errno in the message and the filesystem type hosting OLLAMA_MODELS
- Move models to a native local filesystem (ext4/APFS/NTFS) if on NFS/FUSE
- Verify the file is not truncated: compare its size to the digest in the manifest ('ollama show <model>') and re-pull if short
- Rebuild with 64-bit file offsets (ensure _FILE_OFFSET_BITS=64 / 64-bit build) if offsets exceed 2GiB
- Retry after remounting/repairing the volume if errno indicates a transient FS fault
Defensive patterns
Strategy: validation
Validate before calling
// before serving a model: sanity-check blob size against manifest digest
fi, _ := os.Stat(blobPath);
if expected > 0 && fi != nil && fi.Size() < expected { return fmt.Errorf("truncated blob: %d < %d", fi.Size(), expected) } Try / catch
if (!read_at(path, offset, dst, size)) {
// differentiate seek vs read via the logged message; abort load with a clear error
return false; // propagate to GGUF loader as tensor-read failure
} Prevention
- Keep models on native local filesystems; avoid NFS/FUSE for >2GiB blobs
- Build 64-bit with _FILE_OFFSET_BITS=64 for large-offset seeks
- Repair storage (fsck/disk utility) when EIO/ESPIPE errno values appear
- Keep free disk headroom so writes are never truncated mid-pull
When it happens
Trigger: offsets beyond 2GiB on platforms/builds without _FILE_OFFSET_BITS=64 (EFBIG/EOVERFLOW-style failures); EFAULT/ESPIPE on exotic filesystems that don't support arbitrary seeks (some FUSE mounts, pipes if a path resolved oddly); file truncated on disk (sparse file collapse, disk filling tool, snapshot rollback) making the offset invalid; interrupted system call (EINTR-class) under heavy load.
Common situations: Large multi-GB models on 32-bit builds or non-standard filesystems; VM/container overlays with flaky large-file support; storage that silently truncates files (full disks with sparse handling); models on NFS/FUSE mounts under load.
Related errors
- %s: open failed path=%s offset=%zu size=%zu errno=%d (%s)\n
- %s: read failed path=%s offset=%zu size=%zu got=%zu errno=%d
- Failed to fetch models: ${err}
- Failed to pull model: ${response.statusText}
- Failed to fetch model recommendations: ${response.statusText
AI-assisted analysis of ollama/ollama@e5a81899d0 (2026-08-15).
Data as JSON: /api/errors/15b40a0c26ae0119.
Report an issue: GitHub.