{"record":{"id":"dd17c65e9a08973f","repo":"juicedata/juicefs","slug":"write-message-s","errorCode":null,"errorMessage":"write message: %s","messagePattern":"write message: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":145,"sourceCode":"\tcontentSize := 8 + 8 + 8 + 1 + uint32(len(dstName)) + 2 + 1 + 1 // +1 for threads\n\twb := utils.NewBuffer(uint32(headerSize) + contentSize)\n\twb.Put32(meta.Clone)\n\twb.Put32(contentSize)\n\twb.Put64(srcIno)\n\twb.Put64(srcParentIno)\n\twb.Put64(dstParentIno)\n\twb.Put8(uint8(len(dstName)))\n\twb.Put([]byte(dstName))\n\twb.Put16(uint16(umask))\n\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 {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/clone.go#L127-L163","documentation":"JuiceFS clone works by writing a serialized Clone control message to the control file (.control) exposed by the FUSE mount at the SRC mount point. If the write to that control pipe fails, the command reports \"write message: %s\" with the underlying error — typically a broken pipe, ENOSPC/EDQUOT, or I/O error on the mount.","triggerScenarios":"Running `juicefs clone` when the FUSE mount has just unmounted or crashed (broken pipe / transport endpoint not connected); the control file write fails due to disk/memory pressure; the mount process was killed between openController and the Write.","commonSituations":"Mount daemon restarted or crashed mid-command; volume unmounted by autofs idle timeout; FUSE connection aborted (dmesg shows fuse issues); running clone against a mount whose daemon was OOM-killed.","solutions":["Check the mount is alive: `juicefs status META-URL` and `ls /mnt/jfs/.control`; if dead, remount with `juicefs mount`","Inspect kernel logs (`dmesg | grep -i fuse`) for a FUSE abort and remount after fixing the cause","Retry the clone once the mount is healthy — the operation is not partially applied if the message never reached the daemon","Avoid autofs idle unmounts during long operations (raise the autofs timeout)"],"exampleFix":"# before (mount crashed)\njuicefs clone /mnt/jfs/a /mnt/jfs/b  # write message: broken pipe\n// after\njuicefs mount redis://127.0.0.1:6379/1 /mnt/jfs\njuicefs clone /mnt/jfs/a /mnt/jfs/b","handlingStrategy":"retry","validationCode":"if _, err := os.Stat(filepath.Join(mountpoint, \".control\")); err != nil {\n    return fmt.Errorf(\"mount at %s is not serving control file: %w\", mountpoint, err)\n}","typeGuard":null,"tryCatchPattern":"err := runClone(src, dst)\nif err != nil && (strings.Contains(err.Error(), \"broken pipe\") || strings.Contains(err.Error(), \"transport endpoint\")) {\n    remount(mountpoint)\n    err = runClone(src, dst)\n}","preventionTips":["Check mount health (ls the mountpoint) before long-running operations","Monitor the mount daemon for crashes/OOM","Disable aggressive autofs idle unmounts during batch jobs","Watch `dmesg` for FUSE aborts in flaky environments"],"tags":["cli","fuse","control-file","io"],"backgroundTag":"broken-pipe","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"}