{"record":{"id":"0cdd9a2aadbf718c","repo":"abiosoft/colima","slug":"s-overlaps-s","errorCode":null,"errorMessage":"'%s' overlaps '%s'","messagePattern":"'(.+?)' overlaps '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/vm/lima/yaml.go","lineNumber":444,"sourceCode":"\t\treturn util.CleanPath(m.MountPoint)\n\t}\n\n\treturn util.CleanPath(m.Location)\n}\n\nfunc checkOverlappingMounts(mounts []config.Mount) error {\n\tfor i := 0; i < len(mounts)-1; i++ {\n\t\ta, err := selectPath(mounts[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor j := i + 1; j < len(mounts); j++ {\n\t\t\tb, err := selectPath(mounts[j])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif strings.HasPrefix(a, b) || strings.HasPrefix(b, a) {\n\t\t\t\treturn fmt.Errorf(\"'%s' overlaps '%s'\", a, b)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// disableHas checks if the provided feature is indeed found in the disable configuration slice.\nfunc ingressDisabled(disableFlags []string) bool {\n\tdisabled := func(s string) bool { return s == \"traefik\" || s == \"ingress\" }\n\tfor i, f := range disableFlags {\n\t\tif f == \"--disable\" {\n\t\t\tif len(disableFlags)-1 <= i {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif disabled(disableFlags[i+1]) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tcontinue","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/yaml.go#L426-L462","documentation":"Thrown while generating the Lima VM config at start: checkOverlappingMounts rejects any two mounts whose effective guest paths nest (one is a string prefix of the other). Lima itself cannot handle overlapping mounts (lima-vm/lima#302), so colima refuses to boot the VM rather than produce a broken 9p/virtiofs setup. The compared path is selectPath(m): MountPoint when set, otherwise Location, after util.CleanPath.","triggerScenarios":"colima start with mounts like --mount ~ and --mount ~/dev (or /Users/me plus /Users/me/projects); a mount whose MountPoint lands inside another mount's Location; paths that look distinct (trailing slash, relative, ~ vs /Users/x) but CleanPath to a nested prefix.","commonSituations":"Keeping the default '~' mount while adding a project-specific mount; profiles created by older colima versions whose persisted mounts are now validated on upgrade; reusing CI scripts that stack --mount flags.","solutions":["Drop the narrower mount (e.g. remove '~/dev' and keep '~'), or drop '~' and mount only the subdirectory","If both are needed, set the inner mount's MountPoint outside the outer mount's path so selectPath() results no longer nest","Inspect the saved profile config (~/.colima/_lima/<profile>/*.yaml, 'colima list') for stale overlapping mounts and edit settings.yaml or recreate the profile with a non-overlapping set","Apply changes with colima stop && colima start (or colima start --mount ... on a fresh profile)"],"exampleFix":"# before (overlaps: ~ contains ~/dev)\ncolima start --mount ~ --mount ~/dev:w\n\n# after (single wide mount)\ncolima start --mount ~:w","handlingStrategy":"validation","validationCode":"// Run before colima start / writing mount config.\nfunc mountsOverlap(a, b string) bool {\n    ac, _ := filepath.Abs(filepath.Clean(expandTilde(a)))\n    bc, _ := filepath.Abs(filepath.Clean(expandTilde(b)))\n    if ac == \"/\" || bc == \"/\" { return true } // root contains everything\n    return strings.HasPrefix(ac+\"/\", bc+\"/\") || strings.HasPrefix(bc+\"/\", ac+\"/\")\n}\n\nfunc validateMounts(mounts []string) error {\n    for i := 0; i < len(mounts)-1; i++ {\n        for j := i + 1; j < len(mounts); j++ {\n            locI := strings.Split(mounts[i], \":\")[0]\n            locJ := strings.Split(mounts[j], \":\")[0]\n            if mountsOverlap(locI, locJ) {\n                return fmt.Errorf(\"mount %q overlaps %q\", locI, locJ)\n            }\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := checkOverlappingMounts(conf.Mounts); err != nil {\n    return fmt.Errorf(\"mounts invalid: %w — remove nested mounts or relocate one MountPoint\", err)\n}","preventionTips":["Mount the widest path once (e.g. just '~') instead of stacking subdirectory mounts","When adding a mount, diff it against existing mounts (and their MountPoints) with a prefix check before applying","Keep colima start scripts in version control so mount lists don't accrete flags across invocations","Remember MountPoint counts too: the overlap test uses MountPoint when set, not just Location"],"tags":["lima","mounts","configuration","vm","filesystem"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}