{"record":{"id":"cb56fa552f810322","repo":"juicedata/juicefs","slug":"find-more-than-one-mount-process-for-s","errorCode":null,"errorMessage":"find more than one mount process for %s","messagePattern":"find more than one mount process for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/debug_unix.go","lineNumber":83,"sourceCode":"\tlines := strings.Split(string(ret), \"\\n\")\r\n\tfor i := len(lines) - 1; i >= 0; i-- {\r\n\t\tline := lines[i]\r\n\t\tfields := strings.Fields(line)\r\n\t\tif len(fields) <= 7 {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tcmdFields := fields[7:]\r\n\t\tfor _, arg := range cmdFields {\r\n\t\t\tif mp == arg {\r\n\t\t\t\tif find {\r\n\t\t\t\t\tnewCmd := strings.Join(fields[7:], \" \")\r\n\t\t\t\t\tnewUid, newPid, newPpid := strings.TrimSpace(fields[0]), strings.TrimSpace(fields[1]), strings.TrimSpace(fields[2])\r\n\t\t\t\t\tif newPid == ppid {\r\n\t\t\t\t\t\treturn uid, pid, cmd, nil\r\n\t\t\t\t\t} else if pid == newPpid {\r\n\t\t\t\t\t\treturn newUid, newPid, newCmd, nil\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn \"\", \"\", \"\", fmt.Errorf(\"find more than one mount process for %s\", mp)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcmd = strings.Join(fields[7:], \" \")\r\n\t\t\t\tuid, pid, ppid = strings.TrimSpace(fields[0]), strings.TrimSpace(fields[1]), strings.TrimSpace(fields[2])\r\n\t\t\t\tfind = true\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif cmd == \"\" {\r\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"no mount command found for %s\", mp)\r\n\t}\r\n\treturn uid, pid, cmd, nil\r\n}\r\n","sourceCodeStart":65,"sourceCodeEnd":97,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/debug_unix.go#L65-L97","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Identify duplicates with `ps -ef | grep mount | grep <mp>` and unmount the stale ones (`sudo umount -l <mp>`).","Ensure only one `juicefs mount` process serves the path, then re-run `juicefs debug`.","Avoid creating processes whose command line contains the raw mount point path while debugging (they can confuse the grep-based scan)."],"exampleFix":"// before (two mounts on /jfs)\n$ ps -ef | grep mount | grep /jfs   # shows two juicefs processes\n$ juicefs debug /jfs\n// after\n$ sudo umount /jfs                   # drop the stale one\n$ juicefs debug /jfs","handlingStrategy":"validation","validationCode":"out, _ := exec.Command(\"ps\", \"-ef\").Output()\nn := 0\nfor _, l := range strings.Split(string(out), \"\\n\") {\n  if strings.Contains(l, \"mount\") && strings.Contains(l, mp) { n++ }\n}\nif n > 1 { return fmt.Errorf(\"%d candidate mount processes for %s; unmount stale ones first\", n, mp) }","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Keep exactly one mount per path; clean up after crashed mounts","Don't name other processes' arguments with the raw mount path while debugging","List candidates with `ps -ef | grep mount | grep <mp>` before running debug"],"tags":["cli","process","mount"],"backgroundTag":"ambiguous-mount-process","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}