juicedata/juicefs · warning

failed to lookup inode for %s: %s

Error message

failed to lookup inode for %s: %s

What it means

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.

Source

Thrown at cmd/debug.go:512

		logger.Infof("Stats metrics are being sampled, sampling duration: %ds", stats)
		time.Sleep(time.Second * time.Duration(stats))
		destPath = filepath.Join(currDir, fmt.Sprintf("stats.%ds.txt", stats))
		if err := copyFile(srcPath, destPath, requireRootPrivileges); err != nil {
			logger.Errorf("Failed to get volume config %s: %v", statsName, err)
		}
	}()
	return nil
}

func debug(ctx *cli.Context) error {
	setup(ctx, 1)
	mp := ctx.Args().First()
	var inode uint64
	if err := utils.WithTimeout(context.TODO(), func(context.Context) error {
		var err error
		if inode, err = utils.GetFileInode(mp); err != nil {
			return fmt.Errorf("failed to lookup inode for %s: %s", mp, err)
		}
		return nil
	}, 3*time.Second); err != nil {
		logger.Warn(err.Error())
		logger.Warnf("assuming the mount point is JuiceFS mount point")
	} else {
		if inode != uint64(meta.RootInode) {
			return fmt.Errorf("path %s is not a mount point", mp)
		}
	}

	amp, err := filepath.Abs(mp)
	if err != nil {
		return fmt.Errorf("failed to get absolute path: %v", err)
	}
	timestamp := time.Now().Format("20060102150405")
	prefix := strings.Trim(strings.Join(strings.Split(amp, "/"), "-"), "-")
	if runtime.GOOS == "windows" {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Check the path exists and is accessible: `ls -ld <mp>`.
  2. If the FUSE mount is hung (stat blocks), unmount/remount the volume and retry.
  3. Note this is only a warning — the command continues, comparing against `meta.RootInode` is skipped; treat subsequent output with care.
  4. Review the wrapped `%s` error to distinguish not-found from timeout/unsupported-platform causes.

Example fix

// before
$ juicefs debug /mnt/typo
2026/09/06 failed to lookup inode for /mnt/typo: no such file or directory
// after
$ ls /mnt && juicefs debug /mnt/jfs
Defensive patterns

Strategy: fallback

Validate before calling

if _, err := os.Stat(mp); err != nil { return fmt.Errorf("mount point %s not accessible: %w", mp, err) }

Type guard

null

Try / catch

err := runDebug(mp)
if err != nil && strings.Contains(err.Error(), "failed to lookup inode") {
    logger.Warn("inode lookup failed; treating path as JuiceFS mount point")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/520beb5aadc229df. Report an issue: GitHub.