{"record":{"id":"72930684ee537562","repo":"juicedata/juicefs","slug":"lookup-inode-for-s-s-729306","errorCode":null,"errorMessage":"lookup inode for %s: %s","messagePattern":"lookup inode for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/rmr.go","lineNumber":105,"sourceCode":"\t\t} else if runtime.GOOS == \"windows\" && !utils.IsWinAdminOrElevatedPrivilege() {\n\t\t\tlogger.Fatalf(\"Removing files directly requires Administrator or elevated privilege on Windows\")\n\t\t}\n\t\tflag = 1\n\t}\n\tprogress := utils.NewProgress(false)\n\tspin := progress.AddCountSpinner(\"Removing entries\")\n\tfor i := 0; i < ctx.Args().Len(); i++ {\n\t\tpath := ctx.Args().Get(i)\n\t\tp, err := filepath.Abs(path)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"abs of %q: %s\", path, err)\n\t\t\tcontinue\n\t\t}\n\t\td := filepath.Dir(p)\n\t\tname := filepath.Base(p)\n\t\tinode, err := utils.GetFileInode(d)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"lookup inode for %s: %s\", d, err)\n\t\t}\n\t\tf, err := openController(d)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Open control file for %q: %s\", d, err)\n\t\t\tcontinue\n\t\t}\n\t\twb := utils.NewBuffer(8 + 8 + 1 + uint32(len(name)) + 1 + 1)\n\t\twb.Put32(meta.Rmr)\n\t\twb.Put32(8 + 1 + uint32(len(name)) + 1 + 1)\n\t\twb.Put64(inode)\n\t\twb.Put8(uint8(len(name)))\n\t\twb.Put([]byte(name))\n\t\twb.Put8(flag)\n\t\twb.Put8(uint8(numThreads))\n\t\t_, err = f.Write(wb.Bytes())\n\t\tif err != nil {\n\t\t\tlogger.Fatalf(\"write message: %s\", err)\n\t\t}","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/rmr.go#L87-L123","documentation":"`juicefs rmr` removes a subtree directly through the mount's control file instead of walking the FUSE mount. For each argument path it needs the inode of the path's parent directory, obtained via utils.GetFileInode, so it can address the metadata engine. This error is returned when that inode lookup fails, aborting the whole rmr run.","triggerScenarios":"Running `juicefs rmr <path>` where filepath.Dir(abs(path)) is not a file on a JuiceFS mount — e.g. the parent directory does not exist, the path is on a non-JuiceFS filesystem (GetFileInode cannot resolve an inode), or the mount is broken/unmounted so the statx/stat ioctl that reads the inode fails.","commonSituations":"Typo in the target path so the parent dir is missing; running rmr against a path outside any JuiceFS mount point; the volume was unmounted between listing and removal; permission problems prevent stat'ing the parent directory.","solutions":["Verify the path exists and its parent directory is inside a live JuiceFS mount (`ls <dir>` before rmr)","Check the mount with `juicefs status` / `df` and remount if needed","Run rmr as a user that can stat the parent directory (root may be needed for --skip-trash)","Remove the path through the normal filesystem (rm -r) if inode addressing is not required"],"exampleFix":"// before\njuicefs rmr /mnt/jfs/old-data/missing-subdir\n// error: lookup inode for /mnt/jfs/old-data/missing-subdir: ...\n// after\nls /mnt/jfs/old-data  # confirm parent exists on the mounted volume\njuicefs rmr /mnt/jfs/old-data","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(filepath.Dir(path)); err != nil {\n\tlog.Fatalf(\"parent dir not accessible: %v\", err)\n}","typeGuard":"null","tryCatchPattern":"if err := runRmr(path); err != nil {\n\tif strings.Contains(err.Error(), \"lookup inode for\") {\n\t\t// path is not on a live JuiceFS mount; fall back to os.RemoveAll\n\t\tos.RemoveAll(path)\n\t}\n}","preventionTips":["Confirm the target is inside a mounted JuiceFS volume before rmr","Stat the parent directory in a pre-check","Keep the mount alive for the duration of the operation","Use --skip-trash only as root with a verified path"],"tags":["filesystem","inode","cli","juicefs"],"backgroundTag":"file-not-found","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"}