{"record":{"id":"710057d5a712bc23","repo":"ipfs/kubo","slug":"not-mounted","errorCode":null,"errorMessage":"not mounted","messagePattern":"not mounted","errorType":"error_code","errorClass":"ErrNotMounted","httpStatus":null,"severity":"info","filePath":"fuse/mount/fuse.go","lineNumber":15,"sourceCode":"// FUSE mount/unmount lifecycle. go-fuse only builds on linux, darwin, and freebsd.\n//go:build (linux || darwin || freebsd) && !nofuse\n\npackage mount\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/hanwen/go-fuse/v2/fs\"\n\t\"github.com/hanwen/go-fuse/v2/fuse\"\n)\n\nvar ErrNotMounted = errors.New(\"not mounted\")\n\n// mount implements go-ipfs/fuse/mount.\ntype mount struct {\n\tmpoint string\n\tserver *fuse.Server\n\n\tactive     bool\n\tactiveLock *sync.RWMutex\n\n\tunmountOnce sync.Once\n}\n\n// NewMount mounts a FUSE filesystem at a given location, and returns a Mount instance.\nfunc NewMount(root fs.InodeEmbedder, mountpoint string, opts *fs.Options) (Mount, error) {\n\tPlatformMountOpts(&opts.MountOptions)\n\tif opts.RootStableAttr == nil {\n\t\topts.RootStableAttr = &fs.StableAttr{Ino: RootIno}\n\t}","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/fuse/mount/fuse.go#L1-L33","documentation":"ErrNotMounted is the sentinel error ('not mounted') returned by mount.Unmount when the FUSE mount is not currently active. Callers should compare with errors.Is/mount.ErrNotMounted to treat it as a benign no-op rather than a failure.","triggerScenarios":"Calling Unmount() on a mount that was already unmounted externally (e.g. user ran fusermount -u), never mounted, or whose server has exited (IsActive() == false).","commonSituations":"User manually unmounted the MFS/IPFS FUSE mount with fusermount, double-unmount during daemon shutdown, or the mount crashed and tests expect the sentinel.","solutions":["Check m.IsActive() before calling Unmount, or treat ErrNotMounted as success","Use errors.Is(err, mount.ErrNotMounted) to filter it out of error handling","If the mount should be active, check the FUSE server logs and /sys/fs/fuse connections for crashes","Remount the directory with the normal mount command if it was externally unmounted"],"exampleFix":"// before\nif err := target.Unmount(); err != nil {\n    t.Fatal(err)\n}\n// after\nif err := target.Unmount(); err != nil && !errors.Is(err, mount.ErrNotMounted) {\n    t.Fatal(err)\n}","handlingStrategy":"type-guard","validationCode":"if m.IsActive() {\n    err := m.Unmount()\n}","typeGuard":"func isNotMounted(err error) bool { return errors.Is(err, mount.ErrNotMounted) }","tryCatchPattern":"if err := m.Unmount(); err != nil && !errors.Is(err, mount.ErrNotMounted) {\n    return fmt.Errorf(\"unmount %s: %w\", m.MountPoint(), err)\n}","preventionTips":["Always check IsActive() before Unmount","Treat ErrNotMounted as success in idempotent shutdown paths","Detect external unmounts by comparing mount tables"],"tags":["fuse","sentinel-error","unmount"],"backgroundTag":"not-mounted","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"}