kopia/kopia · error
Unable to get volume size info
Error message
Unable to get volume size info
What it means
During snapshot estimation, the estimator first tries a cheap 'rough' path: it calls getVolumeSizeInfoFn on the entry's local filesystem path to read volume-level file count and used size from the OS. If that underlying filesystem/volume query fails, the error is wrapped as "Unable to get volume size info". Estimation cannot use the fast path, and depending on the caller this may fail the estimate entirely rather than falling back to classic scanning.
Solutions
- Check the source path exists and is on a locally supported filesystem (df -T <path>); prefer estimating a path on a local disk.
- Re-run the estimate; if only the fast path is broken, use the classic estimator by forcing/using a code path that falls back to doClassicEstimation.
- Fix mount/permission issues on the volume so statfs/volume-info queries succeed for the user running kopia.
- Update kopia — volume-info support for network filesystems has improved across releases.
Example fix
// before: estimating a network mount root $ kopia snapshot estimate /mnt/nas/media // after: run estimate against a locally-mounted path, or remount properly $ df -T /mnt/nas/media # diagnose filesystem type $ sudo mount -t nfs4 server:/export/media /mnt/nas/media
Defensive patterns
Strategy: try-catch
Validate before calling
// Go: probe volume info before estimating
func volumeInfoAvailable(path string) bool {
if fi, err := os.Stat(path); err != nil || !fi.IsDir() { return false }
var st syscall.Statfs_t
return syscall.Statfs(path, &st) == nil
} Type guard
func isLocalVolumePath(path string) bool {
var st syscall.Statfs_t
if err := syscall.Statfs(path, &st); err != nil { return false }
return st.Fstype != syscall.NFS_SUPER_MAGIC // exclude known network filesystems
} Try / catch
fc, size, err := estimator.estimate(ctx)
if err != nil && strings.Contains(err.Error(), "Unable to get volume size info") {
// network/unusual filesystem: fall back to classic scan or report unknown
log.Warnf("volume info unavailable for %s, skipping rough estimate: %v", path, err)
} Prevention
- Run estimates on local filesystems where volume stats are supported; expect network mounts to lack them.
- Verify the source path exists (test -d / os.Stat) immediately before estimating.
- Check mount health (df, mount) for the source volume before long estimation runs.
- Keep kopia updated for broader filesystem support in volume info.
When it happens
Trigger: doRoughEstimation calls e.getVolumeSizeInfoFn(e.entry.LocalFilesystemPath()); the platform volume-info API fails for that path — e.g. the path is not on a local volume (NFS/SMB/network mount), the path no longer exists, or the OS call returns an error (Windows GetDiskFreeSpaceEx / volume quota APIs, Linux statfs-based sizing).
Common situations: Estimating a snapshot source that is a network share or fuse mount where volume size info is unavailable; source directory deleted or renamed between starting kopia and estimation; permissions on the mount point prevent querying volume stats; running kopia on an unusual filesystem (tmpfs variant, container bind mount) unsupported by the volume-info implementation.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- cannot iterate directory
- error acquiring maintenance lock
- error adding content to cache
- error creating directory
- error creating file
AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07).
Data as JSON: /api/errors/2c0111ad603e7b3f.
Report an issue: GitHub.
Appendix: source
Thrown at snapshot/upload/upload_estimator.go:165
})
}
func (e *estimator) Wait() {
e.scanWG.Wait()
e.cancelCtx = nil
}
func (e *estimator) Cancel() {
if e.cancelCtx != nil {
e.cancelCtx()
e.cancelCtx = nil
}
}
func (e *estimator) doRoughEstimation() (filesCount, totalFileSize int64, err error) {
volumeSizeInfo, err := e.getVolumeSizeInfoFn(e.entry.LocalFilesystemPath())
if err != nil {
return 0, 0, errors.Wrap(err, "Unable to get volume size info")
}
return int64(volumeSizeInfo.FilesCount), int64(volumeSizeInfo.UsedSize), nil //nolint:gosec
}
func (e *estimator) doClassicEstimation(ctx context.Context) (filesCount, totalFileSize int64, err error) {
var res scanResults
err = Estimate(ctx, e.entry, e.policyTree, &res, 1)
if err != nil {
return 0, 0, errors.Wrap(err, "Unable to scan directory")
}
return int64(res.numFiles), res.totalFileSize, nil
}
View on GitHub (pinned to 82495e54b5)