{"record":{"id":"752d5bcd7869b2e8","repo":"ipfs/kubo","slug":"umount-timeout","errorCode":null,"errorMessage":"umount timeout","messagePattern":"umount timeout","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"fuse/mount/mount.go","lineNumber":56,"sourceCode":"\t\treturn err\n\t}\n\n\terrc := make(chan error, 1)\n\tgo func() {\n\t\tdefer close(errc)\n\n\t\t// try vanilla unmount first.\n\t\tif err := exec.Command(\"umount\", point).Run(); err == nil {\n\t\t\treturn\n\t\t}\n\n\t\t// retry to unmount with the fallback cmd\n\t\terrc <- cmd.Run()\n\t}()\n\n\tselect {\n\tcase <-time.After(7 * time.Second):\n\t\treturn fmt.Errorf(\"umount timeout\")\n\tcase err := <-errc:\n\t\treturn err\n\t}\n}\n\n// UnmountCmd creates an exec.Cmd that is GOOS-specific\n// for unmount a FUSE mount.\nfunc UnmountCmd(point string) (*exec.Cmd, error) {\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\treturn exec.Command(\"diskutil\", \"umount\", \"force\", point), nil\n\tcase \"linux\":\n\t\tif _, err := exec.LookPath(\"fusermount3\"); err == nil {\n\t\t\treturn exec.Command(\"fusermount3\", \"-u\", point), nil\n\t\t}\n\t\treturn exec.Command(\"fusermount\", \"-u\", point), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unmount: unimplemented\")","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/fuse/mount/mount.go#L38-L74","documentation":"ForceUnmount runs a GOOS-specific unmount command (fusermount/fusermount3/diskutil) asynchronously and gives up after 7 seconds with the literal error 'umount timeout'. The unmount command hung, usually because processes still hold files open on the mount.","triggerScenarios":"ForceUnmount called while processes have open FDs or CWDs inside the mount and neither fusermount nor the fallback command completes within 7 seconds; dead FUSE connection blocking the unmount syscall.","commonSituations":"A crashed test left processes stuck in D state on a dead FUSE mount; NFS-like stalls; fusermount3 missing so fallback retries slowly.","solutions":["Abort the FUSE connection first: echo 1 > /sys/fs/fuse/connections/<id>/abort, then fusermount3 -u -z <path>","Find and kill processes using the mount (fuser -vm <path>, lsof +f -- <path>) then retry","Clean up stale mounts under /tmp after crashed tests before re-running","Increase patience or run unmount lazily (-z) if busy unmounts are expected"],"exampleFix":"// manual recovery\nconnId=$(awk '$0 ~ /\\/tmp\\/TestMount/ {split($3,a,\":\"); print a[3]}' /proc/self/mountinfo)\necho 1 > /sys/fs/fuse/connections/$connId/abort\nfusermount3 -u -z /tmp/TestMount123/001","handlingStrategy":"retry","validationCode":"// pre-check: no processes should hold the mount\nexec.Command(\"fuser\", \"-vm\", mountpoint).Run() // non-zero exit means free","typeGuard":null,"tryCatchPattern":"if err := mount.ForceUnmount(m); err != nil && err.Error() == \"umount timeout\" {\n    // abort the dead FUSE connection, then retry\n    abortFuseConnection(mountpoint)\n    time.Sleep(time.Second)\n    err = mount.ForceUnmount(m)\n}","preventionTips":["Close files and change CWDs out of the mount before unmounting","Abort dead FUSE connections before forcing unmounts","Avoid SIGKILLing processes that hold the mount open"],"tags":["fuse","unmount","timeout"],"backgroundTag":"umount-timeout","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}