{"record":{"id":"0157202e6a6cf880","repo":"juicedata/juicefs","slug":"space-not-enough-on-device","errorCode":null,"errorMessage":"space not enough on device","messagePattern":"space not enough on device","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/chunk/disk_cache.go","lineNumber":47,"sourceCode":"\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/charlievieth/fastwalk\"\n\t\"github.com/dustin/go-humanize\"\n\t\"github.com/google/uuid\"\n\t\"github.com/juicedata/juicefs/pkg/utils\"\n)\n\nvar (\n\tstagingDir          = \"rawstaging\"\n\tcacheDir            = \"raw\"\n\tmaxIODur            = time.Second * 30\n\tstagingBlocks       atomic.Int64\n\terrStageFull        = errors.New(\"space not enough on device\")\n\terrStageConcurrency = errors.New(\"concurrent staging limit reached\")\n)\n\ntype cacheKey struct {\n\tid   uint64\n\tindx uint32\n\tsize uint32\n}\n\nfunc (k cacheKey) String() string { return fmt.Sprintf(\"%d_%d_%d\", k.id, k.indx, k.size) }\n\ntype pendingFile struct {\n\tkey       string\n\tpage      *Page\n\tdropCache bool\n}\n\ntype diskCache struct {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/chunk/disk_cache.go#L29-L65","documentation":"errStageFull signals that the staging directory's device has run out of space (or is at its configured staging limit), so a new cache block cannot be staged on disk and the block is uploaded directly to object storage instead. It is returned by the disk cache's stagePath path when stageFull is set or free space checks fail.","triggerScenarios":"Calling the disk-cache staging write path (cache.stage -> stagePath) when cache.stageFull is true, i.e. after the staging device failed a free-space/min-free-ratio check.","commonSituations":"The disk holding the cache dir (rawstaging) fills up during heavy random-read workloads; writeback mode enabled with a small or nearly full cache volume.","solutions":["Free space on the device backing the cache/staging directory or point --cache-dir to a larger volume.","Lower the staging pressure by reducing --max-staging-write-hours or increasing --free-space disk ratio so staging evicts earlier.","Ensure writeback uploaders can keep up (increase upload bandwidth/limits) so staged blocks drain; the client falls back to direct upload in the meantime."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before mounting, check cache device free space\nst, _ := os.Statvfs(cacheDir) // or syscall.Statfs\nif float64(st.Bavail)*float64(st.Bsize) < minFreeBytes { /* enlarge or clean disk */ }","typeGuard":null,"tryCatchPattern":"path, err := cache.Stage(key, data)\nif errors.Is(err, chunk.ErrStageFull) {\n\tlogger.Warnf(\"staging full, uploading %s directly\", key)\n\treturn uploadDirect(key, data)\n}","preventionTips":["Monitor free space on the cache volume","Set a conservative --free-space ratio","Ensure writeback uploads keep up with writes"],"tags":["disk","cache","space"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}