{"record":{"id":"520beb5aadc229df","repo":"juicedata/juicefs","slug":"failed-to-lookup-inode-for-s-s","errorCode":null,"errorMessage":"failed to lookup inode for %s: %s","messagePattern":"failed to lookup inode for (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/debug.go","lineNumber":512,"sourceCode":"\n\t\tlogger.Infof(\"Stats metrics are being sampled, sampling duration: %ds\", stats)\n\t\ttime.Sleep(time.Second * time.Duration(stats))\n\t\tdestPath = filepath.Join(currDir, fmt.Sprintf(\"stats.%ds.txt\", stats))\n\t\tif err := copyFile(srcPath, destPath, requireRootPrivileges); err != nil {\n\t\t\tlogger.Errorf(\"Failed to get volume config %s: %v\", statsName, err)\n\t\t}\n\t}()\n\treturn nil\n}\n\nfunc debug(ctx *cli.Context) error {\n\tsetup(ctx, 1)\n\tmp := ctx.Args().First()\n\tvar inode uint64\n\tif err := utils.WithTimeout(context.TODO(), func(context.Context) error {\n\t\tvar err error\n\t\tif inode, err = utils.GetFileInode(mp); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to lookup inode for %s: %s\", mp, err)\n\t\t}\n\t\treturn nil\n\t}, 3*time.Second); err != nil {\n\t\tlogger.Warn(err.Error())\n\t\tlogger.Warnf(\"assuming the mount point is JuiceFS mount point\")\n\t} else {\n\t\tif inode != uint64(meta.RootInode) {\n\t\t\treturn fmt.Errorf(\"path %s is not a mount point\", mp)\n\t\t}\n\t}\n\n\tamp, err := filepath.Abs(mp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get absolute path: %v\", err)\n\t}\n\ttimestamp := time.Now().Format(\"20060102150405\")\n\tprefix := strings.Trim(strings.Join(strings.Split(amp, \"/\"), \"-\"), \"-\")\n\tif runtime.GOOS == \"windows\" {","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/debug.go#L494-L530","documentation":"The `juicefs debug` command looks up the inode of the given mount point path via `utils.GetFileInode` inside a 3-second timeout. If the lookup fails (path doesn't exist, unsupported platform, permission issue), the error is wrapped with this message, logged as a warning, and the command continues assuming it is a JuiceFS mount point.","triggerScenarios":"Running `juicefs debug <mp>` where `utils.GetFileInode(mp)` returns an error — the path does not exist, is not accessible, or the OS does not support the inode stat call — or the lookup exceeds the 3-second timeout.","commonSituations":"Typo in the mount point path; debugging on a platform where inode retrieval is unsupported; a hung FUSE mount making `stat` on the mount point block past the 3-second deadline.","solutions":["Check the path exists and is accessible: `ls -ld <mp>`.","If the FUSE mount is hung (stat blocks), unmount/remount the volume and retry.","Note this is only a warning — the command continues, comparing against `meta.RootInode` is skipped; treat subsequent output with care.","Review the wrapped `%s` error to distinguish not-found from timeout/unsupported-platform causes."],"exampleFix":"// before\n$ juicefs debug /mnt/typo\n2026/09/06 failed to lookup inode for /mnt/typo: no such file or directory\n// after\n$ ls /mnt && juicefs debug /mnt/jfs","handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(mp); err != nil { return fmt.Errorf(\"mount point %s not accessible: %w\", mp, err) }","typeGuard":"null","tryCatchPattern":"err := runDebug(mp)\nif err != nil && strings.Contains(err.Error(), \"failed to lookup inode\") {\n    logger.Warn(\"inode lookup failed; treating path as JuiceFS mount point\")\n}","preventionTips":["Pass an existing, accessible path","Unmount hung FUSE mounts before debugging (stat can block)","Remember this is a non-fatal warning; verify subsequent output"],"tags":["cli","filesystem","stat"],"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"}