{"record":{"id":"7e1024b9345265be","repo":"juicedata/juicefs","slug":"clone-failed-v","errorCode":null,"errorMessage":"clone failed: %v","messagePattern":"clone failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":155,"sourceCode":"\twb.Put8(cmode)\n\twb.Put8(uint8(threads))\n\tf, err := openController(srcMp)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tif _, err = f.Write(wb.Bytes()); err != nil {\n\t\treturn fmt.Errorf(\"write message: %s\", err)\n\t}\n\n\tprogress := utils.NewProgress(false)\n\tdefer progress.Done()\n\tbar := progress.AddCountBar(\"Cloning entries\", 0)\n\tif _, errno := readProgress(f, func(count uint64, total uint64) {\n\t\tbar.SetTotal(int64(total))\n\t\tbar.SetCurrent(int64(count))\n\t}); errno != 0 {\n\t\treturn fmt.Errorf(\"clone failed: %v\", errno)\n\t}\n\treturn nil\n}\n\nfunc findMountpoint(fpath string) (string, error) {\n\tfor p := fpath; p != \"/\"; p = filepath.Dir(p) {\n\t\tinode, err := utils.GetFileInode(p)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"get inode of %s: %s\", p, err)\n\t\t}\n\t\tif inode == uint64(meta.RootInode) {\n\t\t\treturn p, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"%s is not inside JuiceFS\", fpath)\n}\n","sourceCodeStart":137,"sourceCodeEnd":172,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/clone.go#L137-L172","documentation":"After writing the Clone request to the mount's control file, the command reads progress replies from the same pipe. The FUSE daemon responds with a final errno; any non-zero errno (clone aborted inside the daemon) is reported as \"clone failed: %v\" with the numeric error. This means the request was delivered but the server-side clone operation itself failed.","triggerScenarios":"The metadata engine rejects or fails the internal clone transaction — e.g. quota exceeded (EDQUOT), metadata backend connection lost, destination vanished mid-clone, internal lock conflicts, or the target name became occupied during the operation.","commonSituations":"Directory quota hit while cloning a large tree; Redis/SQL/TiKV metadata backend temporarily unreachable or timing out; concurrent operations removed the SRC or created DST concurrently; too many threads (—threads) hammering a slow metadata backend.","solutions":["Read the numeric errno and correlate it with errno meanings (28=ENOSPC/quota, 11=EAGAIN retry, etc.)","Check volume quota: `juicefs quota` and raise it or free space before cloning","Verify the metadata engine is healthy and reachable (logs of the mount daemon: `juicefs mount` output / log file)","Reduce --threads and retry to lower metadata contention","Re-run the command after transient backend issues; ensure DST does not exist (delete partial results first)"],"exampleFix":"# before\njuicefs clone /mnt/jfs/bigdir /mnt/jfs/bigdir-copy  # clone failed: quota exceeded\n// after\njuicefs quota set /mnt/jfs --capacity 1024000\njuicefs clone /mnt/jfs/bigdir /mnt/jfs/bigdir-copy","handlingStrategy":"retry","validationCode":"if quotaUsed(root) >= quotaLimit(root) {\n    return errors.New(\"insufficient quota for clone; raise quota or free space\")\n}","typeGuard":null,"tryCatchPattern":"if err := runClone(src, dst); strings.Contains(err.Error(), \"clone failed:\") {\n    if isTransient(err) { time.Sleep(retryDelay); err = runClone(src, dst) } // ensure DST absent first\n}","preventionTips":["Check `juicefs quota` capacity before cloning large trees","Keep the metadata backend (Redis/SQL/TiKV) healthy and monitored","Avoid concurrent clone/delete of the same paths","Start with low --threads and scale up based on backend latency"],"tags":["cli","fuse","metadata","errno"],"backgroundTag":"upstream-api-error","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}