{"record":{"id":"2c0111ad603e7b3f","repo":"kopia/kopia","slug":"unable-to-get-volume-size-info","errorCode":null,"errorMessage":"Unable to get volume size info","messagePattern":"Unable to get volume size info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/upload/upload_estimator.go","lineNumber":165,"sourceCode":"\t})\n}\n\nfunc (e *estimator) Wait() {\n\te.scanWG.Wait()\n\te.cancelCtx = nil\n}\n\nfunc (e *estimator) Cancel() {\n\tif e.cancelCtx != nil {\n\t\te.cancelCtx()\n\t\te.cancelCtx = nil\n\t}\n}\n\nfunc (e *estimator) doRoughEstimation() (filesCount, totalFileSize int64, err error) {\n\tvolumeSizeInfo, err := e.getVolumeSizeInfoFn(e.entry.LocalFilesystemPath())\n\tif err != nil {\n\t\treturn 0, 0, errors.Wrap(err, \"Unable to get volume size info\")\n\t}\n\n\treturn int64(volumeSizeInfo.FilesCount), int64(volumeSizeInfo.UsedSize), nil //nolint:gosec\n}\n\nfunc (e *estimator) doClassicEstimation(ctx context.Context) (filesCount, totalFileSize int64, err error) {\n\tvar res scanResults\n\n\terr = Estimate(ctx, e.entry, e.policyTree, &res, 1)\n\tif err != nil {\n\t\treturn 0, 0, errors.Wrap(err, \"Unable to scan directory\")\n\t}\n\n\treturn int64(res.numFiles), res.totalFileSize, nil\n}\n","sourceCodeStart":147,"sourceCodeEnd":181,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/upload/upload_estimator.go#L147-L181","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before: estimating a network mount root\n$ kopia snapshot estimate /mnt/nas/media\n// after: run estimate against a locally-mounted path, or remount properly\n$ df -T /mnt/nas/media   # diagnose filesystem type\n$ sudo mount -t nfs4 server:/export/media /mnt/nas/media","handlingStrategy":"try-catch","validationCode":"// Go: probe volume info before estimating\nfunc volumeInfoAvailable(path string) bool {\n    if fi, err := os.Stat(path); err != nil || !fi.IsDir() { return false }\n    var st syscall.Statfs_t\n    return syscall.Statfs(path, &st) == nil\n}","typeGuard":"func isLocalVolumePath(path string) bool {\n    var st syscall.Statfs_t\n    if err := syscall.Statfs(path, &st); err != nil { return false }\n    return st.Fstype != syscall.NFS_SUPER_MAGIC // exclude known network filesystems\n}","tryCatchPattern":"fc, size, err := estimator.estimate(ctx)\nif err != nil && strings.Contains(err.Error(), \"Unable to get volume size info\") {\n    // network/unusual filesystem: fall back to classic scan or report unknown\n    log.Warnf(\"volume info unavailable for %s, skipping rough estimate: %v\", path, err)\n}","preventionTips":["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."],"tags":["kopia","estimation","filesystem","volume-info"],"backgroundTag":"unsupported-operation","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}