{"record":{"id":"298d2dde05af947f","repo":"ipfs/kubo","slug":"unmount-unimplemented","errorCode":null,"errorMessage":"unmount: unimplemented","messagePattern":"unmount: unimplemented","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"fuse/mount/mount.go","lineNumber":74,"sourceCode":"\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\")\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}","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/fuse/mount/mount.go#L56-L92","documentation":"UnmountCmd builds the platform-specific unmount command for a mountpoint; on platforms other than linux (and darwin/other handled branches above) it returns the error 'unmount: unimplemented', meaning ForceUnmount cannot work on this GOOS.","triggerScenarios":"Calling ForceUnmount/UnmountCmd on a GOOS that lacks a dedicated case (e.g. windows, freebsd, openbsd) — any forced-unmount attempt at runtime on an unsupported platform.","commonSituations":"Running kubo FUSE mount tests or auto-unmount logic on an OS without fusermount/diskutil support; cross-platform code assuming Linux semantics.","solutions":["Run on Linux (fusermount3/fusermount) or macOS (diskutil) where unmount is implemented","On unsupported platforms, avoid ForceUnmount and use the mount server's own Unmount() (go-fuse) instead","Guard code paths with runtime.GOOS checks so forced unmounts are only attempted on supported systems"],"exampleFix":"// before\nerr := mount.ForceUnmountManyTimes(m, 10)\n// after\nif runtime.GOOS != \"linux\" && runtime.GOOS != \"darwin\" {\n    err = m.Unmount() // go-fuse server unmount, portable\n} else {\n    err = mount.ForceUnmountManyTimes(m, 10)\n}","handlingStrategy":"validation","validationCode":"switch runtime.GOOS {\ncase \"linux\", \"darwin\":\n    // safe to call UnmountCmd\ndefault:\n    // do not call; use m.Unmount() or skip\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate ForceUnmount calls behind runtime.GOOS checks","On unsupported platforms rely on the go-fuse server's own Unmount","Test mount code paths per target OS in CI"],"tags":["fuse","platform","unmount"],"backgroundTag":"unimplemented-platform","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"}