{"record":{"id":"3bcbd22cf5ed430d","repo":"juicedata/juicefs","slug":"failed-to-read-config","errorCode":null,"errorMessage":"failed to read config","messagePattern":"failed to read config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/umount.go","lineNumber":109,"sourceCode":"\t\treturn fmt.Errorf(\"OS %s is not supported\", runtime.GOOS)\n\t}\n\tout, err := cmd.CombinedOutput()\n\tif err != nil && len(out) != 0 {\n\t\terr = errors.New(string(out))\n\t}\n\treturn err\n}\n\nfunc umount(ctx *cli.Context) error {\n\tsetup(ctx, 1)\n\tmp := ctx.Args().Get(0)\n\tif ctx.Bool(\"flush\") {\n\t\traw, err := readConfig(mp)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn fmt.Errorf(\"not a JuiceFS mount point\")\n\t\t\t}\n\t\t\treturn errors.Wrap(err, \"failed to read config\")\n\t\t}\n\n\t\tvar conf vfs.Config\n\t\tif err = json.Unmarshal(raw, &conf); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to parse config\")\n\t\t}\n\t\tif conf.Chunk.Writeback {\n\t\t\tstagingDir := path.Join(conf.Chunk.CacheDir, \"rawstaging\")\n\t\t\tif err := waitWritebackComplete(stagingDir); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tsize, _ := fileSizeInDir(stagingDir)\n\t\t\t\tclearLastLine()\n\t\t\t\tif size == 0 {\n\t\t\t\t\tfmt.Println(\"\\rAll staging chunks are flushed\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"\\r%s staging chunks are not flushed\\n\", humanize.IBytes(size))","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/umount.go#L91-L127","documentation":"Wraps an error from readConfig(mp) when `juicefs umount --flush` reads the JuiceFS volume config from the mount point. Unlike the ENOENT case (which reports 'not a JuiceFS mount point'), this fires for all other read failures — permission problems, I/O errors, or malformed mountpoint access.","triggerScenarios":"Running `juicefs umount <mp> --flush` where reading `.config` (or the config access path) inside the mountpoint fails with an error other than NotExist: no read permission on the mountpoint, stale/hung FUSE mount returning EIO/EACCES, network filesystem shadowing, or the mount process crashed leaving a broken mount.","commonSituations":"Unmounting a FUSE mountpoint whose juicefs process has died (mountpoint hangs, I/O errors); running as a user without permission to traverse the mountpoint; NFS/other fs mounted at the same path; dying metadata connection making any read on the mount fail.","solutions":["Read the full wrapped cause to identify the underlying errno (EACCES vs EIO vs ESTALE)","Check the mount is alive: `mountpoint <mp>` and `ls <mp>`; if hung, use `juicefs umount --force <mp>` (without --flush)","Retry with sufficient permissions (root/sudo) if it is an access error","If the FUSE connection is dead, force-unmount (`fusermount -uz <mp>`) and remount"],"exampleFix":"// before\njuicefs umount /mnt/jfs --flush        # hangs / EIO, dead mount\n// after\nsudo umount -l /mnt/jfs                # or fusermount -uz /mnt/jfs, then remount\nsudo juicefs umount /mnt/jfs --flush   # retry flush with proper permissions on healthy mount","handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(mp); err != nil { return fmt.Errorf(\"mountpoint missing: %w\", err) }\nif out, err := exec.Command(\"mountpoint\", mp).CombinedOutput(); err != nil { return fmt.Errorf(\"not a mountpoint: %s\", out) }","typeGuard":null,"tryCatchPattern":"if err := umountCmd(mp, true); err != nil {\n\tvar perr *fs.PathError\n\tif errors.As(err, &perr) && errors.Is(err, syscall.EIO) { /* dead mount: force unmount */ }\n}","preventionTips":["Verify the mountpoint is alive (`ls <mp>`) before umount --flush","Keep the juicefs mount process healthy; use --force only as last resort","Run umount with root or the mounting user's permissions"],"tags":["umount","config","fuse","mountpoint"],"backgroundTag":"file-read-failed","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"}