juicedata/juicefs · error

find more than one mount process for %s

Error message

find more than one mount process for %s

What it means

When `ps` output shows more than one candidate mount process for the path, `getCmdMount` tries to disambiguate via parent-pid relationships (the FUSE mount vs. the `juicefs mount` parent). If two processes are related neither as parent nor child, the function gives up with this error rather than guessing.

Source

Thrown at cmd/debug_unix.go:83

	lines := strings.Split(string(ret), "\n")
	for i := len(lines) - 1; i >= 0; i-- {
		line := lines[i]
		fields := strings.Fields(line)
		if len(fields) <= 7 {
			continue
		}
		cmdFields := fields[7:]
		for _, arg := range cmdFields {
			if mp == arg {
				if find {
					newCmd := strings.Join(fields[7:], " ")
					newUid, newPid, newPpid := strings.TrimSpace(fields[0]), strings.TrimSpace(fields[1]), strings.TrimSpace(fields[2])
					if newPid == ppid {
						return uid, pid, cmd, nil
					} else if pid == newPpid {
						return newUid, newPid, newCmd, nil
					} else {
						return "", "", "", fmt.Errorf("find more than one mount process for %s", mp)
					}
				}
				cmd = strings.Join(fields[7:], " ")
				uid, pid, ppid = strings.TrimSpace(fields[0]), strings.TrimSpace(fields[1]), strings.TrimSpace(fields[2])
				find = true
			}
		}
	}
	if cmd == "" {
		return "", "", "", fmt.Errorf("no mount command found for %s", mp)
	}
	return uid, pid, cmd, nil
}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Identify duplicates with `ps -ef | grep mount | grep <mp>` and unmount the stale ones (`sudo umount -l <mp>`).
  2. Ensure only one `juicefs mount` process serves the path, then re-run `juicefs debug`.
  3. Avoid creating processes whose command line contains the raw mount point path while debugging (they can confuse the grep-based scan).

Example fix

// before (two mounts on /jfs)
$ ps -ef | grep mount | grep /jfs   # shows two juicefs processes
$ juicefs debug /jfs
// after
$ sudo umount /jfs                   # drop the stale one
$ juicefs debug /jfs
Defensive patterns

Strategy: validation

Validate before calling

out, _ := exec.Command("ps", "-ef").Output()
n := 0
for _, l := range strings.Split(string(out), "\n") {
  if strings.Contains(l, "mount") && strings.Contains(l, mp) { n++ }
}
if n > 1 { return fmt.Errorf("%d candidate mount processes for %s; unmount stale ones first", n, mp) }

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: Running `juicefs debug <mp>` where the `ps` scan finds multiple mount-command processes for the same mount point that are not in a direct parent/child relationship — e.g. two separate `juicefs mount` invocations using the same mount point, or unrelated processes whose command line merely contains the path.

Common situations: Duplicate mounts over the same directory after a crashed previous mount; `grep` matching an unrelated command containing the mount path string; nested mounts sharing a path prefix.

Related errors


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