{"record":{"id":"2e49ab788104be33","repo":"seaweedfs/seaweedfs","slug":"parent-pid-s-is-invalid-w","errorCode":null,"errorMessage":"parent PID %s is invalid: %w","messagePattern":"parent PID (.+?) is invalid: %w","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"weed/command/fuse_std.go","lineNumber":119,"sourceCode":"\t\t// add value to pending option\n\t\toptions = append(options, parameter{option.String(), \"true\"})\n\t\toption.Reset()\n\t}\n\n\t// scan each parameter\n\tfor i := 0; i < len(options); i++ {\n\t\tparameter := options[i]\n\n\t\tswitch parameter.name {\n\t\tcase \"child\":\n\t\t\tmasterProcess = false\n\t\t\tif parsed, err := strconv.ParseInt(parameter.value, 10, 64); err == nil {\n\t\t\t\tif parsed > math.MaxInt || parsed <= 0 {\n\t\t\t\t\tpanic(fmt.Errorf(\"parent PID %d is invalid\", parsed))\n\t\t\t\t}\n\t\t\t\tmountOptions.fuseCommandPid = int(parsed)\n\t\t\t} else {\n\t\t\t\tpanic(fmt.Errorf(\"parent PID %s is invalid: %w\", parameter.value, err))\n\t\t\t}\n\t\tcase \"arg0\":\n\t\t\tmountOptions.dir = &parameter.value\n\t\tcase \"filer\":\n\t\t\tmountOptions.filer = &parameter.value\n\t\tcase \"filer.path\":\n\t\t\tmountOptions.filerMountRootPath = &parameter.value\n\t\tcase \"dirAutoCreate\":\n\t\t\tif parsed, err := strconv.ParseBool(parameter.value); err == nil {\n\t\t\t\tmountOptions.dirAutoCreate = &parsed\n\t\t\t} else {\n\t\t\t\tpanic(fmt.Errorf(\"dirAutoCreate: %s\", err))\n\t\t\t}\n\t\tcase \"collection\":\n\t\t\tmountOptions.collection = &parameter.value\n\t\tcase \"replication\":\n\t\t\tmountOptions.replication = &parameter.value\n\t\tcase \"disk\":","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/seaweedfs/seaweedfs/blob/1c926e8fac8e8001ce25efa1027c90b02b4a1804/weed/command/fuse_std.go#L101-L137","documentation":"Same child= handling as above, but here strconv.ParseInt(value, 10, 64) itself failed, and the wrapped error names the exact cause: invalid syntax (empty string, letters, a unit suffix like 's') or the value overflowing int64. The child process aborts at startup before any FUSE handshake happens.","triggerScenarios":"-o child= (empty value); -o child=abc; -o child=1234s; child=99999999999999999999 (> int64 range); fstab quoting that splits or empties the value.","commonSituations":"Hand-editing mount option strings while debugging; fstab/systemd units where quoting swallows the value; truncated copy-paste of the master's argv.","solutions":["Drop child= from your invocation - the master generates it automatically","If simulating a child, pass a plain decimal PID with no sign, suffix, or whitespace","For fstab entries, check option quoting so the value is not split on spaces/commas or emptied","Print the exact option string before running to catch truncation"],"exampleFix":"// before\nweed fuse /mnt/sw -o \"filer=localhost:8888,child=self\"\n\n// after\nweed fuse /mnt/sw -o \"filer=localhost:8888\"\n// run the master and let it spawn: weed fuse /mnt/sw -o filer=localhost:8888","handlingStrategy":"validation","validationCode":"func validateChildOption(v string) error {\n\tparsed, err := strconv.ParseInt(v, 10, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"child must be a decimal PID: %w\", err)\n\t}\n\tif parsed <= 0 || parsed > int64(math.MaxInt) {\n\t\treturn fmt.Errorf(\"child PID %d out of range\", parsed)\n\t}\n\treturn nil\n}","typeGuard":"func isValidChildPid(v string) bool {\n\tparsed, err := strconv.ParseInt(v, 10, 64)\n\treturn err == nil && parsed > 0 && parsed <= int64(math.MaxInt)\n}","tryCatchPattern":null,"preventionTips":["Treat child= as an internal option; do not author it by hand","Validate generated fstab/argv strings with a linter or dry-run print","Keep option values free of units and whitespace"],"tags":["fuse","mount","pid","process-management","validation"],"backgroundTag":null,"analyzedSha":"1c926e8fac8e8001ce25efa1027c90b02b4a1804","analyzedAt":"2026-08-15T15:37:02.018Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}