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

  1. Check errno in the message and the filesystem type hosting OLLAMA_MODELS
  2. Move models to a native local filesystem (ext4/APFS/NTFS) if on NFS/FUSE
  3. Verify the file is not truncated: compare its size to the digest in the manifest ('ollama show <model>') and re-pull if short
  4. Rebuild with 64-bit file offsets (ensure _FILE_OFFSET_BITS=64 / 64-bit build) if offsets exceed 2GiB
  5. 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

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


AI-assisted analysis of ollama/ollama@e5a81899d0 (2026-08-15). Data as JSON: /api/errors/15b40a0c26ae0119. Report an issue: GitHub.