{"record":{"id":"1999d47947066497","repo":"ipfs/kubo","slug":"unmount-s-failed-after-10-seconds-of-trying","errorCode":null,"errorMessage":"unmount %s failed after 10 seconds of trying","messagePattern":"unmount (.+?) failed after 10 seconds of trying","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"fuse/mount/mount.go","lineNumber":91,"sourceCode":"\tdefault:\n\t\treturn nil, fmt.Errorf(\"unmount: unimplemented\")\n\t}\n}\n\n// ForceUnmountManyTimes attempts to forcibly unmount a given mount,\n// many times. It does so by calling diskutil or fusermount directly.\n// Attempts a given number of times.\nfunc ForceUnmountManyTimes(m Mount, attempts int) error {\n\tvar err error\n\tfor range attempts {\n\t\terr = ForceUnmount(m)\n\t\tif err == nil {\n\t\t\treturn err\n\t\t}\n\n\t\t<-time.After(time.Millisecond * 500)\n\t}\n\treturn fmt.Errorf(\"unmount %s failed after 10 seconds of trying\", m.MountPoint())\n}\n\ntype closer struct {\n\tM Mount\n}\n\nfunc (c *closer) Close() error {\n\tlog.Warn(\" (c *closer) Close(),\", c.M.MountPoint())\n\treturn c.M.Unmount()\n}\n\nfunc Closer(m Mount) io.Closer {\n\treturn &closer{m}\n}\n","sourceCodeStart":73,"sourceCodeEnd":106,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/fuse/mount/mount.go#L73-L106","documentation":"ForceUnmountManyTimes retries the platform unmount command every 500ms for 10 attempts (~10s total); if the mount still exists it returns 'unmount <path> failed after 10 seconds of trying'. The mountpoint is stuck, typically from processes blocked on a dead FUSE connection.","triggerScenarios":"All 10 ForceUnmount attempts fail while processes hold the mount busy or the FUSE connection is dead (server killed, D-state processes); also triggered when the unmount command itself errors every time (e.g. unimplemented on this GOOS).","commonSituations":"After a crashed or SIGKILLed test/daemon leaving a stale FUSE mount under /tmp; hung readers blocking unmount; repeated `ipfs mount` test reruns.","solutions":["Abort the FUSE connection (echo 1 > /sys/fs/fuse/connections/<id>/abort) then fusermount3 -u -z <path>","Identify blockers with fuser -vm <path> or lsof and kill them, then retry","Remove leftover mountpoints under /tmp after cleaning to avoid tmpwatch/fuser hangs","If on an unsupported GOOS, note ForceUnmount cannot succeed; use the go-fuse server Unmount instead"],"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":"if _, err := os.Stat(m.MountPoint()); err != nil {\n    // mountpoint already gone; skip forced unmount\n}","typeGuard":null,"tryCatchPattern":"err := mount.ForceUnmountManyTimes(m, 10)\nif err != nil {\n    abortFuseConnection(m.MountPoint()) // echo 1 > /sys/fs/fuse/connections/<id>/abort\n    time.Sleep(time.Second)\n    err = mount.ForceUnmountManyTimes(m, 10)\n}","preventionTips":["Ensure the FUSE server is alive before forcing unmounts","Clean up stale /tmp mounts after crashed runs","Kill processes blocked in D state on the mount first"],"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"}